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 the directory user/run, I enter 'gdb' in the command prompt and get the message "*** No targets specified and no makefile found. Stop."
What am I supposed to do to detect the segmentation fault? |
Code:
gdb program core |
Quote:
Code:
gdb /user/project/Build/bin/project core Code:
gdb /user/project/Build/core: No such file or directory. When I then use the command prompt to go into directory Code:
/user/project/Build/bin Code:
gdb project Code:
Thread debugging using libthread_db enabled.. Program exited with code 01. |
ulimit -c will tell you whether crashes will create core files. The core files will typically be named something like core.55909 where 55909 is the process ID. The core file will be located in the current working directory of the process that crashed, which may not be the directory that you are in.
|
Quote:
Code:
/user/project/Build/bin Code:
ulimit -c Code:
/user/project/Build |
You have an interesting experimental approach to finding out what commands do. Boring people just use the man pages.
|
Try running:
Code:
ulimit -c unlimited |
All times are GMT -5. The time now is 05:48 PM. |