You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have an autorelease pool and throw and catch an exception inside, the "reserved" ivar (that contains callstack) of an NSException is deallocated before the instance of NSException.
#0 0x000b082b in handleDealloc at /Users/sidslog/projects/TestException/KSCrash/Source/KSCrash/Recording/Tools/KSZombie.m:149
#1 0x000b07a6 in -[NSObject(KSZombie) dealloc_KSZombieOrig] at /Users/sidslog/projects/TestException/KSCrash/Source/KSCrash/Recording/Tools/KSZombie.m:167
#2 0x00421f18 in -[_NSCallStackArray dealloc] ()
#3 0x0083f772 in objc_object::sidetable_release(bool) ()
#4 0x00840a63 in -[NSObject release] ()
#5 0x00b28c37 in CFRelease ()
#6 0x00b5debe in -[__NSDictionaryM dealloc] ()
#7 0x0083f772 in objc_object::sidetable_release(bool) ()
#8 0x00840a63 in -[NSObject release] ()
#9 0x00c686ec in -[NSException dealloc] ()
#10 0x0083f772 in objc_object::sidetable_release(bool) ()
#11 0x0083ee9b in objc_release ()
#12 0x0083fd32 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
At first it deallocates the callstack then an ivar and only after that an instance of NSException.
When handling the deallocation of an NSException in storeException, there is no "reserved" ivar. So the EXC_BAD_ACCESS happens at line
At my point of view, there is a way to handle this crash - to swizzle the "release" method of NSExcepsion instead of "dealloc". Then the chain of releasing would look like this: NSException -> "reserver" ivar -> callstack. But I haven't tested a lot(
The text was updated successfully, but these errors were encountered:
When you have an autorelease pool and throw and catch an exception inside, the "reserved" ivar (that contains callstack) of an NSException is deallocated before the instance of NSException.
To reproduce the crash
This is how it looks in the debugger
At first it deallocates the callstack then an ivar and only after that an instance of NSException.
When handling the deallocation of an NSException in storeException, there is no "reserved" ivar. So the EXC_BAD_ACCESS happens at line
At my point of view, there is a way to handle this crash - to swizzle the "release" method of NSExcepsion instead of "dealloc". Then the chain of releasing would look like this: NSException -> "reserver" ivar -> callstack. But I haven't tested a lot(
The text was updated successfully, but these errors were encountered: