Sponsored Content
Top Forums Programming Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault Post 302714765 by DGPickett on Friday 12th of October 2012 03:05:21 PM
Old 10-12-2012
Watchdog scripts should move the core file before restarting. I like compressing it into a file with the date-time in another directory, perhaps /tmp so they get cleaned up if they get too large.

Beyond that, I like to scan for core on prod and dev boxes, ls -l it, copy it to /tmp/core.YYYY-MMDD-HHMMSS so it is not overwritten, automatically locate the main code using 'file' and common PATHs, run gdb for a stack trace (where), sending an email to the group with as much info as I could get, so they know one side effect of their activities is this core dump, which might be missed otherwise. Then I compress it in the background and sleep a second to ensure unique naming. A marker file keeps track of my last scan time, so I do not pick up the same files over and over.

But then, I am more into diagnosis by post mortem than running in debug mode. I am not sure what the environment has to do the the SEGV, that is usually a programmer with too much trust of his inputs.
 

10 More Discussions You Might Find Interesting

1. Programming

Hi! segmentation fault

I have written a program which takes a directory as command line arguments and displays all the dir and files in it. I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the... (4 Replies)
Discussion started by: vijlak
4 Replies

2. AIX

Segmentation fault

Hi , During execution a backup binary i get following error "Program error 11 (Segmentation fault), saving core file in '/usr/datatools" Riyaz (2 Replies)
Discussion started by: rshaikh
2 Replies

3. Linux

Segmentation fault

Hi, on a linux Red HAT(with Oracle DB 9.2.0.7) I have following error : RMAN> delete obsolete; RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 2 using channel ORA_DISK_1 Segmentation fault What does it mean ? And the solution ? Many thanks. (0 Replies)
Discussion started by: big123456
0 Replies

4. Programming

segmentation fault

What is segmentation fault(core dumped) (1 Reply)
Discussion started by: gokult
1 Replies

5. Programming

Segmentation fault.

I'm getting a segmentation fault. I'm new to Linux programming. Thanks so much for all of your input.:eek: #include </usr/include/mysql++/mysql++.h> #include <stdio.h> #include <iostream> #include <sstream> #include <string.h> using namespace std; int outputToImport(const char*... (1 Reply)
Discussion started by: sepoto
1 Replies

6. Programming

segmentation fault.

This code is causing a segmentation fault and I can't figure out why. I'm new to UNIX and I need to learn how to avoid this segmentation fault thing. Thank you so much. Thanks also for the great answers to my last post.:):b: int main() { mysqlpp::Connection conn(false); if... (3 Replies)
Discussion started by: sepoto
3 Replies

7. Programming

Segmentation fault gdb

Hello everyone, I am using the debugger from C++ and these are the message I got: Program received signal SIGSEGV, Segmentation fault. 0x0040cc0e in malloc_consolidate (av=0x4ff3c0) at malloc.c:5169 in malloc.c I don't know if the problem is cause i'm trying to acess an invalid memory... (1 Reply)
Discussion started by: juliecf5
1 Replies

8. Homework & Coursework Questions

Segmentation Fault

this is a network programming code to run a rock paper scissors in a client and server. I completed it and it was working without any error. After I added the findWinner function to the server code it starts giving me segmentation fault. -the segmentation fault is fixed Current problem -Also... (3 Replies)
Discussion started by: femchi
3 Replies

9. UNIX for Dummies Questions & Answers

Using gdb to detect segmentation fault in sh?

I am using scientific linux. In the directory user/project/Build, after I ran 'make' to compile and link all the cpp files,I had no problems. But then, when I went to directory user/run/run.sh, which runs the project binary in user/project/Build/bin/project, I get a segmentation fault error. In... (1 Reply)
Discussion started by: larry burns
1 Replies

10. Programming

C. To segmentation fault or not to segmentation fault, that is the question.

Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1... I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one. Below are two very condensed snippets of which I have added the results inside the each code section. IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies
SAFE_ASTERISK(8)					     Linux Programmer's Manual						  SAFE_ASTERISK(8)

NAME
safe_asterisk -- A wrapper to run the asterisk executable in a loop SYNOPSIS
safe_asterisk [ asterisk_params ] DESCRIPTION
safe_asterisk is a script that runs asterisk in a loop, which can be useful if you fear asterisk may crash. The script does not run in the background like a standard service. Rather, it runs in its own linux virtual console (9, by default). It also uses the option '-c' of asterisk(8) to avoid detaching asterisk from that terminal. safe_asterisk also runs asterisk with unlimited core file size, and thus asterisk will dump core in case of a crash. To get a "picture" of console 9, from another terminal (e.g: from a remote shell session) you can use: screendump 9 The init script of the Debian package should be able to run safe_asterisk as the asterisk service, if so configured. See coments in /etc/default/asterisk FILES
/tmp safe_asterisk runs in that directory, rather than in / as usual. /tmp/core If core files were generated there, they may be /etc/asterisk/startup.d Files in this directory will be 'source'd by the safe_asterisk script before it starts Asterisk proper, allowing them to set addi- tional environment variables or run any other steps that are needed for your system. BUGS
While showing the output on a console is useful, using screen(1) as the terminal may be better. The script does not read configuration from standard location under /etc It uses fixed locations under /tmp , and thus may be exposed to a symlink attacks. SEE ALSO
asterisk(8), screendump(9) AUTHOR
This manual page was written by Tzafrir Cohen <tzafrir.cohen@xorcom.com> Permission is granted to copy, distribute and/or modify this docu- ment under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2. Asterisk Jun 30th, 2005 SAFE_ASTERISK(8)
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy