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

Re: Diagnosing corrupted stacks


  • Subject: Re: Diagnosing corrupted stacks
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 29 Apr 2009 19:54:14 -0500

On Apr 29, 2009, at 7:01 PM, Thomas McHale wrote:

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

[...]

So it looks like a corrupted stack problem..

How does one go about diagnosing these kind of bugs?

There's a gcc option, -fstack-protector. http://lists.apple.com/archives/xcode-users/2007/Dec/msg00055.html

I've heard that Valgrind for Mac OS X has made some progress, although I don't know much more about it than that.

You might also try static analysis of your source, to see if it finds any problems. http://clang.llvm.org/StaticAnalysis.html

If those tools don't find the problem, you'll have to do it the hard way. Typically, you have to identify some known point before the corruption, break there, and then step through your program in the debugger. You can also litter the relevant code with printfs/NSLogs at just about every line until you narrow down where it's happening.


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

It should at least break on the signal/exception. Sadly, that's usually too late because the corruption has done its damage.


Good luck,
Ken

_______________________________________________
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: Michael Crawford <email@hidden>
References: 
 >Diagnosing corrupted stacks (From: Thomas McHale <email@hidden>)

  • Prev by Date: Diagnosing corrupted stacks
  • Next by Date: Xcode could not locate source file
  • Previous by thread: Diagnosing corrupted stacks
  • Next by thread: Re: Diagnosing corrupted stacks
  • Index(es):
    • Date
    • Thread