Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
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