What could cause this to fail under MallocScribble?
What could cause this to fail under MallocScribble?
- Subject: What could cause this to fail under MallocScribble?
- From: Jens Alfke <email@hidden>
- Date: Tue, 17 Jun 2008 10:05:09 -0700
[Not directly related to xcode or gdb, but this seems like the most
relevant list for general debugging tools including malloc's...]
I've run into* what appears to be a bug in CoreAudio, which only
manifests when MallocScribble is turned on. The symptom is that a
property-accessor function, which is supposed to copy data into a
buffer, instead copies garbage consisting entirely of 0xAA bytes. Even
though this probably isn't my bug, I'm still trying to think of what
could cause this to happen, and drawing a blank.
I could easily understand this if the garbage consisted of 0x55, since
that's what MallocScribble writes into freed blocks. That would simply
indicate that CoreAudio had just freed the block containing the
property data, before copying it into my buffer.
But 0xAA is the pattern written into _new_, uninitialized malloc
blocks. How could CA be copying from an uninitialized block, but in
the absence of MallocScribble the block just happens to contain the
proper data? I can't figure it out. I'm almost wondering if it's a bug
in the implementation of MallocScribble, somehow.
(I've tried catching it in the act by setting a watchpoint on the
buffer. It gets hit during a memcpy call inside of the CA function;
but I'm not good enough with x86 assembly to figure out where the
source pointer of memcpy may have come from.)
—Jens
* http://lists.apple.com/archives/CoreAudio-API/2008/Jun/msg00133.html
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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