Re: Re: Passing param by reference then using within block throws exception

2016-09-22 Thread Steve Mills

On Sep 22, 2016, at 02:31 PM, Kyle Sluder  wrote:

Are you able to reproduce this in a sample app? I tried the following
but got no crash:

I haven't tried. The real method this came from is much more complex than my 
simplified example; 6 enumerate* loop blocks on dicts and arrays (a couple 
nested), another parameter before the reference parameter, lots of object 
allocation. After spending the bulk of my day on tracking down the problem, I 
don't want to waste more trying to come up with a sample that duplicates it. 
I'm sure you understand. If ARC can't do the right thing, it should be flagged 
as something that the user should change.

Sent from iCloud's ridiculous UI, so, sorry about the formatting

 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Re: Passing param by reference then using within block throws exception

2016-09-22 Thread Kyle Sluder
On Wed, Sep 21, 2016, at 09:22 AM, Steve Mills wrote:
> On Sep 21, 2016, at 08:53 AM, Alex Zavatone  wrote:
> 
> Stab in the dark here, but I'm stabbing blank. Is there an Instruments
> tool or debugging option to detect this? 
> 
> Thanks for getting stabby. Fourvel appreciates it (only relevant if
> you're a CBB fan). It doesn't appear that anything will detect this. When
> zombies is on, it says an address is attempting to be retained but was
> previously released. That's a bit of a red herring, since the only 2
> variables being uses have just been declared and initialized right before
> the call to the method. If anything, the process of converting to ARC or
> the static analyzer should've flagged this as a problem.

Are you able to reproduce this in a sample app? I tried the following
but got no crash:

#include 
#import 

static void foo(NSString **fillMeIn) {
[@[@"a"] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx,
BOOL *stop) {
*fillMeIn = obj;
*stop = YES;
}];
}

int main(int argc, char **argv) {
@autoreleasepool {
NSString *out;
foo();
printf("%s", out.UTF8String);
}
return 0;
}


--Kyle
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com