CrashReporter and gdb disagree on thread numbering (0-based vs. 1-based)

Originator:jhawk
Number:rdar://12705015 Date Originated:14 Nov 2012
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.6/11G63b
Classification:UI/Usability Reproducible:Always
 
14-Nov-2012 08:02 PM John Hawkinson:
Summary:
  CrashReporter and gdb disagree on thread numbering (0-based vs. 1-based).
  CrashReporter numbers threads starting from 0.
  gdb numbers threads starting from 1.

  This is medium-annoying if you are trying to discuss a particular thread in
a core dump with another developer -- are you talking about gdb's thread numbers or about CrashReporter's?

  They should be consistent! Fix one. I would imagine gdb is more standard here, and platform-independent.

Steps to Reproduce:

  Crash an app. Compare CrashReporter and gdb output.

Expected Results:

   Consistent numbering.

Actual Results:

CrashReporter reports this for an Adobe InDesign crash:

    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
    Crashed Thread:  74
    
    Thread 0:  Dispatch queue: com.apple.main-thread
    ...
    Thread 74 Crashed:
    0   com.adobe.InDesign.Text             0x2207a68f GetPlugIn + 945295
    1   com.adobe.InDesign.Text             0x2207a94c GetPlugIn + 945996
    ...
    Thread 77:
    ...
    Thread 74 crashed with X86 Thread State (32-bit):

And in gdb:

  (gdb) info threads
    78 0x923d7412 in __workq_kernreturn ()
    77 0x923dfaa2 in __semwait_signal ()
    76 0x923b1b42 in semaphore_wait_signal_trap ()
    75 ComposeScannerCache::CalculateParagraph (this=0x1cb19468, position=27) at ComposeScanner.cpp:765
    74 0x923b1b5a in semaphore_timedwait_signal_trap ()
    73 0x923b1b5a in semaphore_timedwait_signal_trap ()
  ...
     3 0x923b1b5a in semaphore_timedwait_signal_trap ()
     2 0x923d8382 in kevent ()
  *  1 0x923b9962 in tiny_free_list_add_ptr ()
  Current language:  auto; currently c++
  (gdb)  


That is, crashreporter's Thread 74 is gdb's Thread 75.

Regression:

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!