Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1915] iOS: Analytics crash (SIGABRT) when using featureEvent

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-10-31T00:29:40.000+0000
Affected Version/sRelease 1.5.0
Fix Version/s2012 Sprint 22 Core, 2012 Sprint 22
ComponentsiOS
Labelscore
ReporterRobby
AssigneeMax Stepanov
Created2011-04-15T03:05:29.000+0000
Updated2017-03-08T23:59:56.000+0000

Description

SDK 1.4.1.1 on iOS SDK 4.1. I figured I'd use Ti.Analytics custom events to get more info out of my app. So, I added a number of them around my codebase, using syntax such as:

Ti.Analytics.featureEvent("myevent1");
Ti.Analytics.featureEvent("myevent2", {extraData: "test"});
(seems pretty sane, along what the docs say).

However, when I start my app up, after the first analytics call the app will predictably crash within 30 seconds with EXC_CRASH (SIGABRT) and a reason of "NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'". This crash happens in both the simulator, and on a device (both iOS 3.1.3 and 4.1). Removing just these calls and deleting/reinstalling the app on the phone/simulator makes the app run fine without crashes, and adding them back in starts the crashes again.

I've tried removing the build directory and regenerating it, and am going from a fresh install of Titanium that works fine with everything else.

A full trace of the crashes is at: http://pastebin.com/Gvf39NLg">http://pastebin.com/Gvf39NLg

P.S. Looking at AnalyiticsModule.m (http://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/AnalyticsModule.m">http://github.com/appcelerator/titanium_mobile/blob/master/iphone/C...) line 164 could be the culprit...if for some reason what's coming back in line 163 is nil (as no validation is done to it).

Comments

  1. Robby 2011-04-15

    Wanted to add that the crashes will begin after I've hit one of those fireEvent lines. If I actually remove the calls, I need to delete and reinstall the app on my phone to get rid of the SQL database that Analytics has. Otherwise, I'll just start it up again and it will crash again within 20-30 seconds. With a fresh install on the device then, things work fine as long as I don't hit a fireEvent line.

  2. Robby 2011-04-15

    Marshall: Just wanted to make this ticket aware to you guys, as some other folks have created some analytics-crashing related tickets. Analytics may need some TLC. :)

  3. Stephen Tramer 2011-04-15

    Probably fixed along with many other analytics bugs.

  4. Stephen Tramer 2012-07-26

    Confirmed SDK 2.2.0.014b86f. Code snippet alone is enough to reproduce on simulator.
  5. Max Stepanov 2012-10-31

    Was able to reproduce with build 014b86f. Cannot reproduce on master/3_0_X/2_1_X branches.
  6. Lee Morris 2017-03-08

    Closing ticket as the issue cannot be reproduced.

JSON Source