On Monday, February 24, 2003, at 07:28 AM, [EMAIL PROTECTED] wrote:
Message: 6
Date: Sun, 23 Feb 2003 22:16:32 -0500
From: Ima Sudonim <[EMAIL PROTECTED]>
To: flightgear flightgear <[EMAIL PROTECTED]>
Subject: [Flightgear-devel] EXC_BAD_ACCESS in modified FGFS (on mac os x)
Reply-To: [EMAIL PROTECTED]
Are there any ways to test MALLOC/NEW within flightgear looking for bad pointer manipulation or allocation problems? (NOT in CVS but local modifications)
MallocDebug is the program/tool you want. It overrides malloc and free (and hence new) to detect memory allocation errors.
Is there a way to increase the size of the stack given to fgfs in Mac OS X? I heard of a ulimit command but my machine (10.2.4) doesn't seem to have this. Unsure if stack growing into the heap or vice versa is the problem here.
I don't have this either (I used it once on a solaris box). Unless there is infinite recursion, you probably won't overflow the stack. I think you can adjust the underlying thread's stack size though (see man pthread).
This is a modified version of flightgear of a friend with a mixture of C++ and C pointer manipulation.
Any suggestions on how to begin debugging this? They're currently doing the cout/asm ("trap") route. The problem seems specific to memory allocation, some local (stack), some via new. He swears that he isn't deleting anything twice. Problem usually occurs soon after the procedure is called and returns (in a call or object allocation immediately following this proc). The pointer work steps through a buffer got from handleBufferRead() (netBufferChannel)
It's probably got a memory smasher. MallocDebug will help you find it (make sure to read MallocDebug's help docs). You can use MallocDebug within GDB, and there are directions on how to do that. I've used MallocDebug to find many memory-related errors, so feel free to email me off-list for further help.
HTH, Darrell
_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel