• 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
Diagnosing corrupted stacks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Diagnosing corrupted stacks


  • Subject: Diagnosing corrupted stacks
  • From: Thomas McHale <email@hidden>
  • Date: Wed, 29 Apr 2009 17:01:01 -0700

I have a crashing bug in my app.. The CrashTracer report looks something like this:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000001e
Crashed Thread:  0

Thread 0 Crashed:
0   com.apple.AE                  0x928306fb aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) + 323
1   ???                           0x00000003 0 + 3
2   ???                           0x0000001e 0 + 30
.
.
.
Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x0000001e  ebx: 0x928305ce  ecx: 0x00000000  edx: 0x00000000
  edi: 0x00000000  esi: 0xa03c2060  ebp: 0xbffff0c8  esp: 0xbffff080
   ss: 0x0000001f  efl: 0x00010206  eip: 0x928306fb   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x0000001e

So it looks like a corrupted stack problem..

How does one go about diagnosing these kind of bugs? I already made .gdbinit file and put the following in it:

////////////////////////////////////////////////////
define checkheap
set env MallocCheckHeapStart 1
set env MallocCheckHeapEach 500
end

define mallocguard
set env MallocGuardEdges 1
set env MallocCheckHeapAbort 1
set env MallocBadFreeAbort 1
end

define guard
set env DYLD_FORCE_FLAT_NAMESPACE 1
set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.B.dylib
end

define guard-before
set env MALLOC_PROTECT_BEFORE 1
end

define guard-strict
set env MALLOC_STRING_SIZE 1
end

define maxguard
guard
guard-before
guard-strict
end
////////////////////////////////////////////////////

When the crash happens the app just goes poof and in gdb I don't get any helpful info at all.

Are there more extensive ways to configure gdb to catch stack problems?

Thanks,,
Tom McHale


 _______________________________________________
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: Diagnosing corrupted stacks
      • From: John Engelhart <email@hidden>
    • Re: Diagnosing corrupted stacks
      • From: John Engelhart <email@hidden>
    • Re: Diagnosing corrupted stacks
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Not all locals show up in Xcode debugger
  • Next by Date: Re: Diagnosing corrupted stacks
  • Previous by thread: Re: Localizing without Xcode UI
  • Next by thread: Re: Diagnosing corrupted stacks
  • Index(es):
    • Date
    • Thread