• 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: malloc in obj-c/cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc in obj-c/cocoa


  • Subject: Re: malloc in obj-c/cocoa
  • From: Ben Dougall <email@hidden>
  • Date: Fri, 6 Feb 2004 23:47:29 +0000

On Friday, February 6, 2004, at 11:33 pm, Jens Bauer wrote:

Hi Ben,

On Friday, Feb 6, 2004, at 22:14 Europe/Copenhagen, Ben Dougall wrote:

i'm malloc'ing little bits of memory, passing the pointers round and stuff. getting this error:

*** malloc[22753]: error for object 0x7dbd0: Incorrect checksum for freed object - object was probably modified after being freed; break at szone_error

I've seen this ever so often. It's a memory overwrite.

Try disabling your code...

PositionPtr posp;
posp = (PositionPtr) malloc( i ));
while( i >= 0 ) {
// *(posp + i) = *(Buffer + i);
i--;
}

and see if the crash occurs.
If it doesn't, you know that this *is* the place it happens.

yup, you're absolutely right. haven't quite worked out exactly what's happening yet but should be able to now.

thanks very much.
ben.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: malloc in obj-c/cocoa
      • From: Glenn Andreas <email@hidden>
References: 
 >Re: malloc in obj-c/cocoa (From: Jens Bauer <email@hidden>)

  • Prev by Date: Re: malloc in obj-c/cocoa
  • Next by Date: Re: Sorting NSTableView
  • Previous by thread: Re: malloc in obj-c/cocoa
  • Next by thread: Re: malloc in obj-c/cocoa
  • Index(es):
    • Date
    • Thread