I have searched and made sure there are no existing issues for the issue I am filing
Description
Occasionally my app crashes with the following [redacted] stack (full stack at the end):
0 objc_msgSend + 32
1 TiBindingTiValueFromNSObject + 872
2 KrollCallAsFunction + 352
3 JSC::callJSNonFinalObjectCallbackObject(JSC::JSGlobalObject*, JSC::CallFrame*) + 307
12 -[JSValue callWithArguments:] + 267
13 -[KrollTimerTarget timerFired:] + 44
14 __NSFireTimer + 95
The timer is set in KrollTimerManager - setInterval:withCallback:shouldRepeat: as a result of either setTimeout or setInterval Javascript call.
KrollCallAsFunction executes: [KrollObject toValue:[o context] value:result] to get the return value, where result is of type NSArray. It crashes in TiBindingTiValueFromNSObject(jsContext, thisObject) with EXC_BAD_ACCESS (SIGSEGV), so either the jsContext (the KrollMethod taken from func ref) or thisObject (which is the result array) are corrupt.
In iOS, timers are supposed to pause when going to background and resume when returning to foreground. I suspect that what happens was that a timer resumed but the JS context or array got flushed out.
Here's is the full stack of the crash. The crash .ips file from here: titanium_KrollTimerTarget_crash.ips - open it in console or Xcode with the TitaniumKit project).
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x19cd17420 objc_msgSend + 32
1 TitaniumKit 0x10571b1e4 TiBindingTiValueFromNSObject + 872
2 TitaniumKit 0x105761608 KrollCallAsFunction + 352
3 JavaScriptCore 0x1b5e57d1c JSC::callJSNonFinalObjectCallbackObject(JSC::JSGlobalObject*, JSC::CallFrame*) + 307
4 JavaScriptCore 0x1b67cdbc4 JSC::handleHostCall(JSC::VM&, JSC::JSCell*, JSC::CallFrame*, JSC::JSValue, JSC::CallLinkInfo*) + 491
5 JavaScriptCore 0x1b6837c1c llint_default_call + 1039
6 JavaScriptCore 0x1b71f56a4 llint_default_call_trampoline + 23
7 JavaScriptCore 0x1b71f31ec js_trampoline_op_call_ignore_result + 7
8 JavaScriptCore 0x1b71c7cd8 vmEntryToJavaScriptTrampoline + 7
9 JavaScriptCore 0x1b669d26c JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::JSCell*, JSC::ArgList const&) + 395
10 JavaScriptCore 0x1b69303dc JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 119
11 JavaScriptCore 0x1b5e6b6e4 JSObjectCallAsFunction + 223
12 JavaScriptCore 0x1b5e20ec0 -[JSValue callWithArguments:] + 267
13 TitaniumKit 0x1057236f0 -[KrollTimerTarget timerFired:] + 44
14 Foundation 0x19d55c5c0 __NSFireTimer + 95
15 CoreFoundation 0x1a01c94c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 31
16 CoreFoundation 0x1a01c91b8 __CFRunLoopDoTimer + 979
17 CoreFoundation 0x1a01c8d2c __CFRunLoopDoTimers + 279
18 CoreFoundation 0x1a018a208 __CFRunLoopRun + 1815
19 CoreFoundation 0x1a01891d0 _CFRunLoopRunSpecificWithOptions + 531
20 GraphicsServices 0x2456bf498 GSEventRunModal + 119
21 UIKitCore 0x1a5e4d2cc -[UIApplication _run] + 795
22 UIKitCore 0x1a5db8158 UIApplicationMain + 331
23 Spike 0x10495f1ac main + 400
24 dyld 0x19cd9dc1c start + 6927
Expected Behavior
Obviously it shouldn't crash...
Actual behavior
Crash...
Reproducible sample
This doesn't happen often, and I don't know how to reproduce this.
Steps to reproduce
see above
Platform
No response
SDK version you are using
13.2.0.GA
Alloy version you are using
No response
I have searched and made sure there are no existing issues for the issue I am filing
Description
Occasionally my app crashes with the following [redacted] stack (full stack at the end):
The timer is set in
KrollTimerManager - setInterval:withCallback:shouldRepeat:as a result of either setTimeout or setInterval Javascript call.KrollCallAsFunctionexecutes:[KrollObject toValue:[o context] value:result]to get the return value, whereresultis of typeNSArray. It crashes inTiBindingTiValueFromNSObject(jsContext, thisObject)withEXC_BAD_ACCESS (SIGSEGV), so either thejsContext(theKrollMethodtaken fromfuncref) orthisObject(which is theresultarray) are corrupt.In iOS, timers are supposed to pause when going to background and resume when returning to foreground. I suspect that what happens was that a timer resumed but the JS context or array got flushed out.
Here's is the full stack of the crash. The crash .ips file from here: titanium_KrollTimerTarget_crash.ips - open it in console or Xcode with the TitaniumKit project).
Expected Behavior
Obviously it shouldn't crash...
Actual behavior
Crash...
Reproducible sample
This doesn't happen often, and I don't know how to reproduce this.
Steps to reproduce
see above
Platform
No response
SDK version you are using
13.2.0.GA
Alloy version you are using
No response