Search code examples
iosios-simulatorexc-bad-accesstitanium-mobileappcelerator

Figuring out an iOS Simulator crash report


I am writing an App using the Appcelerator framework, and I get occasional crashes. I'm trying to track down whats causing the crash, so I decided to take a look at the iOS simulator crash report. Its of course all greek to me, but was hoping for some guidance on what part of this is a clue to the cause of the crash?

I pulled out the thread which is labeled as 'Crashed', but within that thread there are multiple entries (0-9), listed below. Is there any clue to figuring out which of those entries is causing the problem?

Crashed Thread:        2  KrollContext<kroll$1>

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000bbadbeef


Thread 2 Crashed:: KrollContext<kroll$1>
0   com.a       0x000000010082865e Ti_WTFCrash + 62
1   com.a       0x000000010069ffe9 TiObjectGetProperty + 361
2   com.a       0x00000001002c42e5 -[KrollObject objectForTiString:context:] + 101
3   com.a       0x00000001002bf6a5 KrollGetProperty + 165
4   com.a       0x0000000100656ef7 TI::JSCallbackObject<TI::JSDestructibleObject>::getOwnPropertySlot(TI::JSObject*, TI::ExecState*, TI::PropertyName, TI::PropertySlot&) + 487
5   com.a       0x00000001005e32aa TI::TiValue::get(TI::ExecState*, TI::PropertyName, TI::PropertySlot&) const + 362
6   com.a       0x00000001006f6ec0 llint_slow_path_get_by_id + 192
7   com.a       0x0000000100701711 llint_op_get_by_id + 98
8   com.a       0x0000000100703ae2 llint_op_call + 153
9   com.a       0x00000001006ffea5 callToJavaScript + 191

Solution

  • SIGSEGV errors occur when you try to use an object that already has been garbage collected. It's the equivalent of NullPointer errors on Android.

    Seeing it has callToJavaScript as well would mean a native event or callback is not finding the JavaScript object anymore.

    I'd advise to use the Appcelerator Studio debugger and step through the code to the moment it crashes.