I have a Segmentation Fault: 11 on my Mac. Testing my engine. I am wanting to use gdb to analyze what happened, but I cannot locate a core file. Do I need to set up something at the system level to instruct the machine to dump a core file during a segfault in OSX?
Is there a way to analyze what is happening without the core file? Like can I run gdb then execute the program and attach to the pid or something like that?
Thanks for your consideration.
Jeff
Segmentation Fault
Moderators: hgm, Rebel, chrisw
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
Re: Segmentation Fault
Found it. My ulimit-c was set to 0. I set it to unlimited, ran it again and got the dump in the /cores directory on my system. Now I can run gdb with my engine and the core and see what happened.jsgroby wrote:I have a Segmentation Fault: 11 on my Mac. Testing my engine. I am wanting to use gdb to analyze what happened, but I cannot locate a core file. Do I need to set up something at the system level to instruct the machine to dump a core file during a segfault in OSX?
Is there a way to analyze what is happening without the core file? Like can I run gdb then execute the program and attach to the pid or something like that?
Thanks for your consideration.
Jeff
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Segmentation Fault
You might also look at the .crash file. Check /Library/Logs/CrashReporter and ~/Library/Logs/CrashReporter.jsgroby wrote:Found it. My ulimit-c was set to 0. I set it to unlimited, ran it again and got the dump in the /cores directory on my system. Now I can run gdb with my engine and the core and see what happened.jsgroby wrote:I have a Segmentation Fault: 11 on my Mac. Testing my engine. I am wanting to use gdb to analyze what happened, but I cannot locate a core file. Do I need to set up something at the system level to instruct the machine to dump a core file during a segfault in OSX?
Is there a way to analyze what is happening without the core file? Like can I run gdb then execute the program and attach to the pid or something like that?
Thanks for your consideration.
Jeff
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
Re: Segmentation Fault
Thanks, I was able to get part of the backtrace from that crash file which then allowed me to home in on the problem.zullil wrote:You might also look at the .crash file. Check /Library/Logs/CrashReporter and ~/Library/Logs/CrashReporter.jsgroby wrote:Found it. My ulimit-c was set to 0. I set it to unlimited, ran it again and got the dump in the /cores directory on my system. Now I can run gdb with my engine and the core and see what happened.jsgroby wrote:I have a Segmentation Fault: 11 on my Mac. Testing my engine. I am wanting to use gdb to analyze what happened, but I cannot locate a core file. Do I need to set up something at the system level to instruct the machine to dump a core file during a segfault in OSX?
Is there a way to analyze what is happening without the core file? Like can I run gdb then execute the program and attach to the pid or something like that?
Thanks for your consideration.
Jeff
Jeff