Re: gmalloc prevents a "Bus error"
Re: gmalloc prevents a "Bus error"
- Subject: Re: gmalloc prevents a "Bus error"
- From: Marc Poirier <email@hidden>
- Date: Tue, 4 Oct 2005 00:11:49 -0400
On Oct 3, 2005, at 11:42 PM, Craig Maloney wrote:
Hi all.
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.
I have had this sort of experience with Guard Malloc before a few
times now. What was happening was that I was using an uninitialized
value as an index to an array. With Guard Malloc disabled, the
initial value of the index would be something random from memory, and
when out of the array's allocated bounds, would cause a crash.
However, whenever I ran my software with Guard Malloc enabled, the
index variable would be initialized to 0. So I think that perhaps
Guard Malloc zeroes out all memory allocations? Or maybe this is
just how it's happened to work out for me on a few occasions...
Marc
_______________________________________________
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