Crash when using [NSTimer fire]
Crash when using [NSTimer fire]
- Subject: Crash when using [NSTimer fire]
- From: Gwynne <email@hidden>
- Date: Fri, 19 Nov 2004 12:19:22 -0500
I'm experiencing a confusing crash when using NSTimer's -fire method to
force a timer to fire before its fire date. This happens when using a
timer with a very large interval (close order of 5 years), which I do
in order to avoid having to separate two extremely similar code paths
from each other. I started out with a non-repeating timer, but it would
somehow get invalidated immediately and therefore -fire didn't work. I
switched to a repeating timer (which didn't matter, since the timer's
selector invalidates and removes the timer anyway), and ended up with a
crash inside objc_msgSend() called from [NSCFTimer fire]. I traced it
down at the assembly level, and it seems that the instance of NSTimer
is getting mangled so when it calls -timeInterval on itself, there's an
invalid object there. I could only get the crash to occur without
assembly-level debugging, but there's nothing in my secondary threads
that goes anywhere NEAR that timer. I ran with libguardmalloc, and
nothing's tromping any memory. When I switched to calling the timer's
target/selector directly, the crash vanished and exhaustive testing
with both single-processor and multi-processor has revealed no issues
whatsoever. Is there any known issue with large timer intervals and
[NSTimer fire]?
-- Gwynne, key to the Code that runs us all
Email: email@hidden
Web: http://musicimage.plasticchicken.com/
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden