• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gmalloc prevents a "Bus error"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: gmalloc prevents a "Bus error"
      • From: Markian Hlynka <email@hidden>
  • Prev by Date: Re: gmalloc prevents a "Bus error"
  • Next by Date: Arguments are not being passed correctly -- Please help
  • Previous by thread: Re: gmalloc prevents a "Bus error"
  • Next by thread: Re: gmalloc prevents a "Bus error"
  • Index(es):
    • Date
    • Thread