• 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: Greg Guerin <email@hidden>
  • Date: Sun, 21 Nov 2010 11:55:12 -0700

James Bucanek wrote:

typedef struct {
    int count;
    Record set[kBatchSizeMax];
    } RecordBatch;

-(void) readNamePackagesOp
{
while (!eof) {
RecordBatch batch;
batch.count = 0;


If this code:

RecordBatch batch;
batch.count = 0;

is changed to this:

RecordBatch batch = { 0 };

it should initialize the entire batch struct, instead of just the count member. When an initializer for a composite does not contain values for all members, unspecified members are zeroed. IIRC, AFAIK, YMMV, etc.

I'm also curious if there's still a crash when alloc initWithBytes:length: is used, or an NSMutableData instead of NSData, or if batch is made static (assumed non-reentrant method), or other experimental attempts at changing either how batch is stored or how the NSData* is made. Or was malloc'ing the BatchRecord buffer the only alternative tried?

  -- GG

_______________________________________________
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


  • Prev by Date: Re: Unit Testing in XCode 3.2.3
  • Next by Date: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Previous by thread: Re: Xcode-users Digest, Vol 7, Issue 331
  • Next by thread: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
  • Index(es):
    • Date
    • Thread