Re: how to find a segfault?
Re: how to find a segfault?
- Subject: Re: how to find a segfault?
- From: Markian Hlynka <email@hidden>
- Date: Fri, 9 Jul 2004 15:55:30 -0600
On Jul 9, 2004, at 15:14, Brent Gulanowski wrote:
On Jul 9, 2004, at 4:50 PM, Markian Hlynka wrote:
Ok, my program has a seg fault:
myMona has exited due to signal 11 (SIGSEGV).
if I was using gdb/gcc on the CLI, I'd run it through GDB and type
"where".
I did this on the console drawer in xcode's debugger, and I get a
note:
GDB: Loading 104819 stack frames... (9%)
now, it's going up VERY slowly. too slowly to be useful.
Am I doing something wrong? suggestions?
You are caught in a recursive loop. In AppKit this tends to result
from overriding a method and calling some other method that calls (or
sets a flag that results in a successive call to) the overridden
method. I usually just put a break point in a few likely places and
see which one reveals the recursion in the stack.
yeah, sorry, all, I was really dumb. I had two similarly named
functions, and I called the wrong one. (I don't usually write from the
AppKit). When I ran in gdb, however, this was immediately apparent:
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x0000d030 in Generate_Legal_Moves(Board_T&, __Move_T*)
(theBoard=@0x7f994, movelist=0x7fb28) at
/Users/markian/Documents/Development/PhD/Post-Candidacy/CodeGen/Games/
myMona/applicationDependencies.cc:443
443 { //this function generates all legal moves. make sure
MAX_LEGAL_MOVES
(gdb) where
#0 0x0000d030 in Generate_Legal_Moves(Board_T&, __Move_T*)
(theBoard=@0x7f994, movelist=0x7fb28) at
/Users/markian/Documents/Development/PhD/Post-Candidacy/CodeGen/Games/
myMona/applicationDependencies.cc:443
#1 0x0000d054 in Generate_Legal_Moves(Board_T&, __Move_T*)
(theBoard=@0x7f994, movelist=0x7fb28) at
/Users/markian/Documents/Development/PhD/Post-Candidacy/CodeGen/Games/
myMona/applicationDependencies.cc:455
...
#966 0x0000d054 in Generate_Legal_Moves(Board_T&, __Move_T*)
(theBoard=@0x7f994, movelist=0x7fb28) at
/Users/markian/Documents/Development/PhD/Post-Candidacy/CodeGen/Games/
myMona/applicationDependencies.cc:455
So, my real beef is that is _wasn't readily apparent from within xcode;
I had to run gdb on the CLI. Do you think this qualifies as a worthy
'bug'?
Markian
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.