Sponsored Content
Top Forums Programming Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault Post 302714841 by jim mcnamara on Saturday 13th of October 2012 12:18:34 AM
Old 10-13-2012
You cannot debug kernel code from gdb. You have to use a kernel debugger.

I would suggest that you are probably corrupting the kernel with repeated segfaults.

You probably are not aware, but originally UNIX would panic (crash with a core dump) when any process had a segfault. UNIX is not meant to have bad code violate memory time after time after time. That said, I kinda doubt it is a bug in the true sense of the word.

Your code is acting more like a virus.

What does the system log say about errors? Do you get a core when the system crashes? You probably did get a system dump. You can analyze that system core.

What OS do you have?

You do understand that what I am about to say will let you do what you ask but it may trash your OS eventually:
Block (ignore) the SIGSEGV signal and set up the signal handler to reset the ignore. Then let your code run over and over the bad code until the system dies. Be sure to turn on a full system dump. Some OSes let you turn off system core dumps. You want it on. That may take a lot of GB of disk space. Then go after your bug in the kernel with the correct tool.

I do not know your OS so I cannot give you a better answer.

Last edited by jim mcnamara; 10-13-2012 at 01:30 AM..
This User Gave Thanks to jim mcnamara For This Post:
 

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
CRASH(8)						    BSD System Manager's Manual 						  CRASH(8)

NAME
crash -- FreeBSD system failures DESCRIPTION
This section explains a bit about system crashes and (very briefly) how to analyze crash dumps. When the system crashes voluntarily it prints a message of the form panic: why i gave up the ghost on the console, and if dumps have been enabled (see dumpon(8)), takes a dump on a mass storage peripheral, and then invokes an automatic reboot procedure as described in reboot(8). Unless some unexpected inconsistency is encountered in the state of the file systems due to hardware or software failure, the system will then resume multi-user operations. The system has a large number of internal consistency checks; if one of these fails, then it will panic with a very short message indicating which one failed. In many instances, this will be the name of the routine which detected the error, or a two-word description of the incon- sistency. A full understanding of most panic messages requires perusal of the source code for the system. The most common cause of system failures is hardware failure, which can reflect itself in different ways. Here are the messages which are most likely, with some hints as to causes. Left unstated in all cases is the possibility that hardware or software error produced the mes- sage in some unexpected way. cannot mount root This panic message results from a failure to mount the root file system during the bootstrap process. Either the root file system has been corrupted, or the system is attempting to use the wrong device as root file system. Usually, an alternate copy of the system binary or an alternate root file system can be used to bring up the system to investigate. Most often this is done by the use of the boot floppy you used to install the system, and then using the ``fixit'' floppy. init: not found This is not a panic message, as reboots are likely to be futile. Late in the bootstrap procedure, the system was unable to locate and execute the initialization process, init(8). The root file system is incorrect or has been corrupted, or the mode or type of /sbin/init forbids execution or is totally missing. ffs_realloccg: bad optim ffs_valloc: dup alloc ffs_alloccgblk: cyl groups corrupted ffs_alloccg: map corrupted blkfree: freeing free block blkfree: freeing free frag ifree: freeing free inode These panic messages are among those that may be produced when file system inconsistencies are detected. The problem generally results from a failure to repair damaged file systems after a crash, hardware failures, or other condition that should not normally occur. A file system check will normally correct the problem. timeout table full This really should not be a panic, but until the data structure involved is made to be extensible, running out of entries causes a crash. If this happens, make the timeout table bigger. init died (signal #, exit #) The system initialization process has exited with the specified signal number and exit code. This is bad news, as no new users will then be able to log in. Rebooting is the only fix, so the system just does it right away. That completes the list of panic types you are likely to see. If the system has been configured to take crash dumps (see dumpon(8)), then when it crashes it will write (or at least attempt to write) an image of memory into the back end of the dump device, usually the same as the primary swap area. After the system is rebooted, the program savecore(8) runs and preserves a copy of this core image and the current system in a specified directory for later perusal. See savecore(8) for details. To analyze a dump you should begin by running kgdb(1) on the system load image and core dump. If the core image is the result of a panic, the panic message is printed. For more details consult the chapter on kernel debugging in the FreeBSD Developers' Handbook (http://www.freebsd.org/doc/en/books/developers-handbook/). SEE ALSO
kgdb(1), dumpon(8), reboot(8), savecore(8) HISTORY
The crash manual page first appeared in FreeBSD 2.2. BSD
July 23, 2011 BSD
All times are GMT -4. The time now is 03:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy