Debugging problem
Hi all. I am running into a funny problem, and I am not experienced enough to track it down. I've done a bunch of google searching, reading mailing lists, etc, to no avail. My program seems to be trying to dealloc memory that was never allocated, but there's no error being generated printed into the log.
Instead, the typical OSX dialog comes up that says the app has "Unexpectedly Quit". When I look at the crash report, the stack says that the crash is happening in the [NSKeyedUnarchiver unarchiveObjectWithFile:] method, and further down the chain in [NSKeyedUnarchiver dealloc].
I really have no idea how to track this down. Any strategies or suggestions would be much appreciated. I'd be happy to post my code around the unarchiveObjectWithFile method if it would help.
Thanks.
Instead, the typical OSX dialog comes up that says the app has "Unexpectedly Quit". When I look at the crash report, the stack says that the crash is happening in the [NSKeyedUnarchiver unarchiveObjectWithFile:] method, and further down the chain in [NSKeyedUnarchiver dealloc].
I really have no idea how to track this down. Any strategies or suggestions would be much appreciated. I'd be happy to post my code around the unarchiveObjectWithFile method if it would help.
Thanks.
Thought I'd reply to my own thread in case anyone runs into this.
Because I was not retaining one item upon unarchiving, (it was only one out of many, many objects, and I just missed it every time I would look at the code), when the NSKeyedUnarchiver instance was dealloc-ing itself it of course sent dealloc messages to the root object it had created. Since I hadn't retained one of the NSArray objectsinside of the root object, it was released by the default Autorelease pool and then NSKeyedUnarchiver tried to release it as well.
Kind of strange - when I've run into other dealloc problems in the past the error console was much more helpful. But in this case there was no helpful information at all. At any rate, I learned much more about GDB today.
Because I was not retaining one item upon unarchiving, (it was only one out of many, many objects, and I just missed it every time I would look at the code), when the NSKeyedUnarchiver instance was dealloc-ing itself it of course sent dealloc messages to the root object it had created. Since I hadn't retained one of the NSArray objectsinside of the root object, it was released by the default Autorelease pool and then NSKeyedUnarchiver tried to release it as well.
Kind of strange - when I've run into other dealloc problems in the past the error console was much more helpful. But in this case there was no helpful information at all. At any rate, I learned much more about GDB today.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Much higher framerate when not debugging | monteboyd | 6 | 2,786 |
Feb 24, 2009 12:10 PM Last Post: CarbonX |
|
| Debugging on the iPhone | demonpants | 2 | 2,024 |
Feb 24, 2009 09:33 AM Last Post: dcavanagh |
|

