• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to find a segfault?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to find a segfault?


  • Subject: Re: how to find a segfault?
  • From: Jim Ingham <email@hidden>
  • Date: Fri, 9 Jul 2004 16:23:18 -0700

Yes, file a bug on this. Xcode already fetches the stack in chunks so an insanely deep stack doesn't make it choke up. But it should also display the chunks as it gets them, rather than waiting till it gets all 100 odd thousand frames... That way you would have been able to tell what was going on in Xcode as well.

It should also probably have some logic to say "I found a hundred thousand frames in the backtrace, you probably just want to look at the first 10, right..."

Jim

On Jul 9, 2004, at 2:55 PM, Markian Hlynka wrote:

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.
_______________________________________________
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.


References: 
 >how to find a segfault? (From: Markian Hlynka <email@hidden>)
 >Re: how to find a segfault? (From: Brent Gulanowski <email@hidden>)
 >Re: how to find a segfault? (From: Markian Hlynka <email@hidden>)

  • Prev by Date: Re: Framework subgroups, and Framework header directory creation
  • Next by Date: Re: PMTicketRef and Frameworks
  • Previous by thread: Re: how to find a segfault?
  • Next by thread: Re: how to find a segfault?
  • Index(es):
    • Date
    • Thread