I have a cryptic EXC_BAD_ACCESS when changing some UILabel's frame. The crash is random, usually I have to repeat the conditions for several minutes.

Enabling NSZombies, as well as other memory debug flags (NSDebugEnabled, MallocStackLogging), doesn't help, the crash stills stays as opaque : just a BAD_ACCESS with no message in the console. The target seems correct and alive, so it doesn't look like a deallocated memory problem.

To get some more info, I subclassed UILabel and rewrote the crashing function :

@implementation TestUILabel
- (id<CAAction>)actionForLayer:(CALayer *)layer forKey:(NSString *)event {
    return [super actionForLayer:layer forKey:event];
}
@end

It crashes in the super's method, but on inspection everything seems correct (printing retainCount for 'self' and 'layer' gives respectively 3 and 2) :

(gdb) po self

< TestUILabel: 0x6ac2800; baseClass = UILabel; frame = (173 174; 0 0); text = '54 m²'; opaque = NO; autoresize = LM+TM; autoresizesSubviews = NO; userInteractionEnabled = NO; animations = { position=< CABasicAnimation: 0xe07ba60>; }; layer = < CALayer: 0xbf1b950>>

(gdb) po event

bounds

(gdb) po layer

< CALayer:0xbf1b950; position = CGPoint (173 174); bounds = CGRect (0 0; 0 0); delegate = < TestUILabel: 0x6ac2800; baseClass = UILabel; frame = (173 174; 0 0); text = '54 m²'; opaque = NO; autoresize = LM+TM; autoresizesSubviews = NO; userInteractionEnabled = NO; animations = { position=< CABasicAnimation: 0xe07ba60>; }; layer = < CALayer: 0xbf1b950>>; contents = < CGImage 0xe04ed60>; opacity = 1; animations = [position=< CABasicAnimation: 0xe07ba60>]>

Did someone get a similar problem ? Or have any ideas where this could come from ?

Thanks in advance !

Edit: here's the complete crash backtrace :

Edit
Report