Re: Random (?) Crashs
Re: Random (?) Crashs
- Subject: Re: Random (?) Crashs
- From: Chris Ridd <email@hidden>
- Date: Thu, 12 Dec 2002 08:13:16 +0000
On 11/12/02 9:38 pm, Max Seelemann <email@hidden> wrote:
>
hi.
>
>
I've a big problem with my app.
>
It's an document based one, which loads the view of an separate nib
>
into an TabView.
>
My Problem is, that the App crashes sometimes, I open a file. But just
>
sometimes...
>
>
Exception: EXC_BAD_ACCESS (0x0001)
>
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x0169ac8e
>
>
Thread 0 Crashed:
>
#0 0x90009b74 in szone_calloc
>
#1 0x900099d4 in malloc_zone_calloc
>
#2 0x9068532c in object_getIndexedIvars
>
#3 0x907e1d4c in NSAllocateObject
>
#4 0x931e4458 in -[NSLayoutManager
>
addTemporaryAttributes:forCharacterRange:]
>
#5 0x0000b630 in -[Editor recalStats:] (Editor.m:352)
>
...
Crashes inside malloc are typically because the heap has been corrupted
sometime earlier, and that's usually because you've written to memory that's
been freed. (eg an object that's been released and dealloced.)
>
And always on an call for an NSLayoutManager...
>
(I use two of them for two synchronized TextViews)
>
And this changes with the time. Sometimes here and sometimes there. But
>
even sometimes it doesn't crash.
>
And sometimes I get an error of an wrong checksum of an freed object...
>
>
Do you know, why this can happen? My App even crashed (only two or
>
three times up to now) on
>
an call to - (void)close to an window.
>
>
Can this be an general Problem of my App?? How can I easily detect hard
>
memory leaks??
>
I found some, but I think there is one major, I don't see.
Import NSDebug.h into your code - it has some useful variables that you can
set to debug memory problems.
Also take a look at MallocDebug.app and ObjectAlloc.app.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.