• 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: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system


  • Subject: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 20 Nov 2010 01:09:33 -0600

On Nov 19, 2010, at 5:26 PM, James Bucanek wrote:

> The problem seems to be that NSConcreteData is accessing, or trying to do something with, the address of the buffer used to initialize the NSData object. But the address is a stack frame automatic, and the NSData object was created with +[NSData dataWithBytes:length:], which should copy the contents of the bytes parameter, not hang onto it.

Except that wouldn't explain why it's uninitialized.  Or, at least, I don't see how it does.  (I see how that would break things, of course.)

Do you ever take the -bytes of that data object and cast it to (RecordBatch*), as opposed to (const RecordBatch*)?  Likewise, accessing the 'set' member, even from a (const RecordBatch*), will give you a non-const (Record*).  Does the code then, perhaps, accidentally modify the pointed-to data?  And could it write past the end of the 'set' field (not past the declared size, but of the dynamic size in the 'count' field)?  That might modify the NSConcreteData internals, breaking things.

Also, are you sure that -[InsertNamesOp initWithBatchData:] is properly retaining the passed-in NSData?  Have you run the static analyzer on your code?  Have you tried NSZombieEnabled=YES?  Have you tried MallocScribble=1?


Which line of your real code corresponds to:

==78805==  Uninitialised value was created by a stack allocation
==78805==    at 0x1000E4BA7: -[PackageNames readNamePackagesOp] (PackageNames.m:590)

?

Regards,
Ken

 _______________________________________________
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: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
      • From: James Bucanek <email@hidden>
References: 
 >Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Next by Date: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Previous by thread: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Next by thread: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Index(es):
    • Date
    • Thread