Re: Seeking advice on debugging "real time" programs.
Re: Seeking advice on debugging "real time" programs.
- Subject: Re: Seeking advice on debugging "real time" programs.
- From: "Sean McBride" <email@hidden>
- Date: Tue, 4 Apr 2006 14:53:20 -0400
- Organization: Rogue Research
On 2006-04-04 11:06, John Draper said:
>I did get the MallocDebug to work, but my tests didn't come up with any
>substantial reason why the
>program crashes after a few minutes of running.
I once had a similar task. A realtime product that had some kind of
memory corruption bug. Back then we didn't have guardmalloc, but as you
know that slows things down too much. We did have the various
MallocDebug environment variables, but they also (mostly) slowed things
down too much. But I do suggest trying as many of them as you can,
maybe one at a time. I'm talking about these suckers, btw:
<http://developer.apple.com/releasenotes/DeveloperTools/MallocOptions.html>
If you suspect problems with C++ object allocations, you may be able to
use a lightweight new/delete replacement. I'm not sure which to
recommend these days. We were using CodeWarrior and had some success
with its DebugNew, but I can't recommend it now, its not thread safe,
and maybe doesn't even work with gcc. I haven't tried it, but you might
look at Howard Hinnant's simple_mem_debug, though it's old by now I guess:
<http://groups.google.com/group/codewarrior.mac/tree/browse_frm/thread/
688428e11d0b0079/e94f660f4817a06e?rnum=1&q=howard+hinnant+memory&_done=%
2Fgroup/codewarrior.mac/browse_frm/thread/688428e11d0b0079%
2F4bb302c9281aa46a?lnk=st&q=howard+hinnant+memory&rnum=3%
26#doc_e94f660f4817a06e>
Or you could write your own.
The next thing I did, which you won't like, is remove code until the
problem goes away, add code till it comes back, repeat ad nauseam.
That's how I ended up finding the cause of our memory corruption, and
the cause was a QuickTime bug! argh!
If you could remove enough of your code such that you no longer have a
realtime requirement, you can then test those parts of your code with
guard malloc. Maybe its your UI code that is trashing memory, and that
can be tested and debugged independently of the realtime bits.
Good luck!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden