Re: gmalloc prevents a "Bus error"
Re: gmalloc prevents a "Bus error"
- Subject: Re: gmalloc prevents a "Bus error"
- From: David DeHaven <email@hidden>
- Date: Mon, 3 Oct 2005 20:40:40 -0700
I have a situation where running code from the command line give
"Bus error" (I'm probably going out-of-bounds on an array), running
in gdb (from xcode or manually from a shell) gets a
"EXC_BAD_ACCESS" signal. But then if I want to turn on aggressive
debugging and select the "Enable Guard Malloc" option from the
debug menu, the error completely goes away and the program
terminates normally.
Could someone explain to me in simple terms how turning on the most
aggressive memory checking could make the error disappear
altogether? Sorry if this is a bit elementary.
Simple, "Enable Guard Malloc" is not aggressive memory checking, it's
simply adding guard pages to allocations *over* 4096 bytes.
Read the malloc manpage for details on debugging malloc related
problems... There are more environment variables that you can set to
help trace the problem. Specifically, MallocScribble,
MallocPreScribble and MallocStackLogging in conjunction with leaks
and malloc_history. Set the MallocHelp environment variable to show
malloc debugging help when the program starts.
Some info:
http://developer.apple.com/releasenotes/DeveloperTools/
MallocOptions.html
And "man malloc", "man malloc_history", and "man leaks" from the
command line.
-DrD-
_______________________________________________
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