Re: How to debug a corrupted stack
Re: How to debug a corrupted stack
- Subject: Re: How to debug a corrupted stack
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 6 Aug 2008 07:56:08 -0700
On Tue, Aug 5, 2008 at 7:51 PM, Gerriet M. Denkmann
<email@hidden> wrote:
> I have a document based app which works perfectly with -O0 or -O1 but
> crashes with -O2 or higher.
>
> When the crash occurs the debugger comes up and says: "Previous frame
> identical to this frame (corrupt stack?)"
>
> When I try to step through the function (which is kind of difficult, as the
> optimization has shuffled the lines a lot) at some time the top frame of the
> stack gets duplicated.
>
> The faulty method starts with:
> NSString *path = @"/Users/gerriet/Desktop/some alias"; // error
> with -O2
>
> If it starts with:
> NSString *path = @"/Users/gerriet/Desktop/some file"; // ok
> with -O2
> then everything works perfectly.
>
> When I comment out the place where the error seems to occur, it will just
> occur at some earlier place.
You are moving things around in memory by chaning the length of your
string above and commenting out things. Additionally changing
optimizer settings shuffles things around.
I have a feeling you are hitting an issue cause by an uninitialized
value or something similar in your code that is being hidden in some
situations by the code emitted.
Also are you sure you are getting any runtime exceptions logged?
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden