FROM : Sean McBride
DATE : Thu Aug 26 04:58:25 2004
Steve Sims (<email_removed>) on Tue, Aug 24, 2004 19:06 said:
>Often I will see a malloc error before my app crashes, reporting an
>incorrect checksum for a freed object.
Have you tried breaking there, breakpoint on malloc_printf()?
>I'm at a bit of a loss right now as to how to track this bug down
>further. Any suggestions would be most gratefully received.
Well, I once spent a month or so trying to find a bug that sounds like
yours and here are some of the things I'd suggest, in no order:
- Use everything in NSDebug.h, not just NSZombieEnabled
- use all the malloc env vars, especially set MallocCheckHeapEach to 1
- for C++ new/delete try CodeWarrior's DebugNew (NB its not thread safe)
- try a different IDE/compiler to rule out bugs there
- try different Macs, RAM, OS versions to rule out bugs there
- fix all memory leaks (see MallocDebug, 'leaks' command line tool)
- try malloc_history
- try Apple's guard malloc, or any of the other replacement malloc
implementations.
- use debug variants of Apple's frameworks (easiest by setting
DYLD_IMAGE_SUFFIX env var to _debug)
- rip out code and use process of elimination :(
(My particular bug was nasty, I couldn't use all the debugging facilities
fully, like MallocCheckHeapEach=1, because it was code that interfaced
with hardware, and if I slowed it down too much nothing worked at all.
It also took about 5 hours to repro the bug! :( In the end I had to rip
out code until it went away... in the end, it was a QuickTime bug, fixed
in 10.3. One month down the drain. But I learned a lot about debugging.
hehe)
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Aug 26 04:58:25 2004
Steve Sims (<email_removed>) on Tue, Aug 24, 2004 19:06 said:
>Often I will see a malloc error before my app crashes, reporting an
>incorrect checksum for a freed object.
Have you tried breaking there, breakpoint on malloc_printf()?
>I'm at a bit of a loss right now as to how to track this bug down
>further. Any suggestions would be most gratefully received.
Well, I once spent a month or so trying to find a bug that sounds like
yours and here are some of the things I'd suggest, in no order:
- Use everything in NSDebug.h, not just NSZombieEnabled
- use all the malloc env vars, especially set MallocCheckHeapEach to 1
- for C++ new/delete try CodeWarrior's DebugNew (NB its not thread safe)
- try a different IDE/compiler to rule out bugs there
- try different Macs, RAM, OS versions to rule out bugs there
- fix all memory leaks (see MallocDebug, 'leaks' command line tool)
- try malloc_history
- try Apple's guard malloc, or any of the other replacement malloc
implementations.
- use debug variants of Apple's frameworks (easiest by setting
DYLD_IMAGE_SUFFIX env var to _debug)
- rip out code and use process of elimination :(
(My particular bug was nasty, I couldn't use all the debugging facilities
fully, like MallocCheckHeapEach=1, because it was code that interfaced
with hardware, and if I slowed it down too much nothing worked at all.
It also took about 5 hours to repro the bug! :( In the end I had to rip
out code until it went away... in the end, it was a QuickTime bug, fixed
in 10.3. One month down the drain. But I learned a lot about debugging.
hehe)
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.






Cocoa mail archive

