• 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
Why am I breaking into gdb?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why am I breaking into gdb?


  • Subject: Why am I breaking into gdb?
  • From: Ben Haller <email@hidden>
  • Date: Sun, 29 Nov 2009 19:50:13 -0500

Hi all. I have a really, really dumb question for you. I run my app, do a particular thing in it, and after chugging away calculating for sixty seconds or so, the debugger console suddenly comes alive, and there I am in gdb. The problem is, it's not clear to me why I'm there. The output I see is:

[Session started at 2009-11-29 19:39:55 -0500.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply- load-rules all
Attaching to process 95884.
Pending breakpoint 1 - "objc_exception_throw" resolved
Pending breakpoint 2 - "-[NSException raise]" resolved
(gdb) bt
#0 0x96f21286 in mach_msg_trap ()
#1 0x96f28a7c in mach_msg ()
#2 0x91e2de7e in CFRunLoopRunSpecific ()
#3 0x91e2eaa8 in CFRunLoopRunInMode ()
#4 0x968d82ac in RunCurrentEventLoopInMode ()
#5 0x968d80c5 in ReceiveNextEventCommon ()
#6 0x968d7f39 in BlockUntilNextEventMatchingListInMode ()
#7 0x92a5e6d5 in _DPSNextEvent ()
#8 0x92a5df88 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#9 0x92a56f9f in -[NSApplication run] ()
#10 0x92a241d8 in NSApplicationMain ()
#11 0x0000c5dc in main (argc=1, argv=0xbffff6fc) at /Users/bhaller/ Documents/McGill/Hendry lab/Research/Antikythera root/Antikythera-main/ main.m:38


It's not telling me any reason for me to be there; doesn't seem to be a crash, doesn't seem to be an exception. Thinking it might be an exception that didn't produce any message, I can try:

(gdb) po [$eax className]
Cannot access memory at address 0x10004005

  No dice.  $eax doesn't look much like a pointer.  :->  I can try:

(gdb) info threads
26 process 95884 thread 0x7e6b 0x96f519c6 in kevent ()
25 process 95884 thread 0x98bb 0x96f519c6 in kevent ()
24 process 95884 thread 0x90ff 0x96f519c6 in kevent ()
23 process 95884 thread 0x666b 0x96f519c6 in kevent ()
22 process 95884 thread 0x57e3 0x96f519c6 in kevent ()
21 process 95884 thread 0x8687 0x91e02e5f in __monitor_file_descriptor__ ()
20 process 95884 thread 0x9a83 0x96f519c6 in kevent ()
19 process 95884 thread 0x9b7f 0x91e02e5f in __monitor_file_descriptor__ ()
18 process 95884 thread 0x5833 0x96f519c6 in kevent ()
17 process 95884 thread 0x931b 0x96f519c6 in kevent ()
16 process 95884 thread 0x967b 0x96f519c6 in kevent ()
15 process 95884 thread 0x8077 0x96f519c6 in kevent ()
14 process 95884 thread 0x91b3 0x96f519c6 in kevent ()
13 process 95884 thread 0x8b97 0x96f519c6 in kevent ()
12 process 95884 thread 0x792b 0x96f519c6 in kevent ()
11 process 95884 thread 0x6c3f 0x91e02e5f in __monitor_file_descriptor__ ()
10 process 95884 thread 0x65fb 0x91e02e5f in __monitor_file_descriptor__ ()
9 process 95884 thread 0x7a97 0x91e02e5f in __monitor_file_descriptor__ ()
8 process 95884 thread 0x6f8f 0xffff0269 in ___spin_lock () at / System/Library/Frameworks/System.framework/PrivateHeaders/i386/ cpu_capabilities.h:234
7 process 95884 thread 0x746f 0x91e02e5f in __monitor_file_descriptor__ ()
6 process 95884 thread 0x8c87 0xffff0269 in ___spin_lock () at / System/Library/Frameworks/System.framework/PrivateHeaders/i386/ cpu_capabilities.h:234
5 process 95884 thread 0x847f 0x91e02e5f in __monitor_file_descriptor__ ()
3 process 95884 thread 0x5b07 0x96f212e6 in semaphore_timedwait_signal_trap ()
2 process 95884 thread 0x2a03 0x96f2846e in __semwait_signal ()
* 1 process 95884 thread 0x10b 0x96f21286 in mach_msg_trap ()


Which isn't surprising, since my app uses NSTask to spawn a bunch of other tasks, and then monitors their output with a background read on their stdout NSFileHandle. But the crashing thread seems to just be in mach_msg_trap(), which seems odd. I'm not sure where to go from here. The crash is completely reproducible, but I just can't see what is even causing me to break into gdb, making it a bit hard to debug.

Ideas/suggestions? Sorry for what is, no doubt, my complete cluelessness. :->

Ben Haller
Stick Software

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Why am I breaking into gdb?
      • From: Jens Alfke <email@hidden>
    • Re: Why am I breaking into gdb?
      • From: Scott Ribe <email@hidden>
    • Re: Why am I breaking into gdb?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: All-in-one layout
  • Next by Date: SenTestingKit / SenTestCase not working on iPhone
  • Previous by thread: Re: All-in-one layout
  • Next by thread: Re: Why am I breaking into gdb?
  • Index(es):
    • Date
    • Thread