Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25476] iOS: JSCore enabled app crashes ios app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-11-06T07:32:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterAnthony Chung
AssigneeUnknown
Created2017-11-03T04:57:51.000+0000
Updated2018-08-06T17:52:08.000+0000

Description

true ios app crashes with the following crashlog. Have seen on lower sdks as well. Happens both on iOS simulator and on device. Tested on SDK: 6.3.0.GA Xcode 9. iOS 11. This is stopping our team from using jscore/and safari debugger benefits, which is meant to be default soon in Ti 7+. Also stopping Hyperloop adoption. device.log attached for device app crash.

Attachments

FileDateSize
device.log2017-11-03T04:56:00.000+000083992

Comments

  1. Hans Knöchel 2017-11-03

    Hey Anthony, I'd like to check this out asap. Does it crash immediately after starting the app and does it also reproduce with a new project? Unfortunately there is no test-case attached, so we won't be able to do much at this point. *EDIT*: It looks like being related to closing a window inside a tabgroup that fires events?
  2. Anthony Chung 2017-11-03

    Hi [~hknoechel], I'm not sure what test case to provide because I don't understand what is going on. The app crashes about a minute into opening. I don't need to do anything. Just wait about a minute. You mentioned... "It looks like being related to closing a window inside a tabgroup that fires events?" If there is anything else that you might be able to interpret from the log - that'd be much appreciated. I had trouble understanding the log.I will trace fireevents with windows attached to the tabgroup. Thanks, Anthony
  3. Hans Knöchel 2017-11-03

    The important lines are these ones (from the bottom to the top):
       6  myApp                        	0x0000000102c9d644 -[TiProxy fireEvent:withObject:withSource:propagate:reportSuccess:errorCode:message:] + 808516 (TiProxy.m:1010)
       17  myApp                        	0x0000000102c19400 -[TiViewProxy fireEvent:withObject:withSource:propagate:reportSuccess:errorCode:message:] + 267264 (TiViewProxy.m:1852)
       18  myApp                        	0x0000000102da692c -[TiWindowProxy windowDidClose] + 1894700 (TiWindowProxy.m:0)
       19  myApp                        	0x0000000102c2c1d4 -[TiUIWindowProxy windowDidClose] + 344532 (TiUIWindowProxy.m:249)
       20  myApp                        	0x0000000102da9224 -[TiWindowProxy closeOnUIThread:] + 1905188 (TiWindowProxy.m:0)
       21  myApp                        	0x0000000102da7c3c __23-[TiWindowProxy close:]_block_invoke + 1899580 (TiWindowProxy.m:347)
       22  myApp                        	0x0000000102ccd540 TiThreadPerformOnMainThread + 1004864 (TiBase.m:316)
       23  myApp                        	0x0000000102da7bfc -[TiWindowProxy close:] + 1899516 (TiWindowProxy.m:349)
       24  myApp                        	0x0000000102c4afb8 -[TiUITabProxy closeWindowProxy:animated:] + 470968 (TiUITabProxy.m:194)
       25  myApp                        	0x0000000102c4a37c __30-[TiUITabProxy cleanNavStack:]_block_invoke + 467836 (TiUITabProxy.m:87)
       26  myApp                        	0x0000000102ccd540 TiThreadPerformOnMainThread + 1004864 (TiBase.m:316)
       27  myApp                        	0x0000000102c49ef8 -[TiUITabProxy cleanNavStack:] + 466680 (TiUITabProxy.m:95)
       28  myApp                        	0x0000000102c4add8 -[TiUITabProxy removeFromTabGroup] + 470488 (TiUITabProxy.m:169)
       29  myApp                        	0x0000000102c6ef10 -[TiUITabGroupProxy dealloc] + 618256 (TiUITabGroupProxy.m:33)
       30  myApp                        	0x0000000102bff238 -[KrollObject dealloc] + 160312 (KrollObject.m:507)
       31  myApp                        	0x0000000102bfd8ac KrollFinalizer + 153772 (KrollObject.m:132)
       
    It looks like the tab-groups gets closed and all tabs / windows inside it as well. Also, using an new project (actually with Hyperloop enabled to be sure). It runs since ~ 10min now and working fine. It *could* be a global event like Ti.App.fireEvent that may fire unexpectedly.
  4. Anthony Chung 2017-11-06

    Hi [~hknoechel]! Your extra comments were much appreciated. I was able to fix the bug as a result. JScore looks like it handles setTimeout differently. I don't understand how or why, but when the app calls a setTimeout function after the tabgroup creation, it will crash... if it calls the setTimeout before the tabgroup creation it won't crash. I am using a timeout delay because the tabgroup is heavy and wanted to put some time padding to clear the password on the login screen in the background after the user sees the screen they logged into. I will need to try and find out more about how setTimeouts behave with Jscore enabled. This code has been here for a long time and doesn't crash with previous non-jscore. Thanks so much, Anthony Code snippets below.
       // will crash with jscore if timeout is placed after
       createAndOpenTabGroup();
       
       setTimeout(function() {
       		hideProgressScreen();
       		$.password.value = "";
       		enableButtons();
       }, 1500);
       
       // no crash with jscore if timeout is placed before
       setTimeout(function() {
       		hideProgressScreen();
       		$.password.value = "";
       		enableButtons();
       }, 1500);
       
       createAndOpenTabGroup();
       
  5. Anthony Chung 2017-11-06

    Spoke too soon. Crash still occurring. Thank anyway for pointing me in the right direction. I'll keep digging. You can close this ticket. It must be code specific. If I can recreate the issue, I will file a separate ticket. Much appreciated [~hknoechel].
  6. Hans Knöchel 2017-11-06

    Thanks [~threethirds]. We'll still keep an eye on this one. Using JSCore actually used Apple's build-in JSCore-framework instead of our custom one, which is the future of Titanium and enables pretty interesting things like ES6 already. We may handle setTimeout too manual right now, so you don't need to change to much in the future. Let us know if you see any other problems!
  7. Eric Merriman 2018-08-06

    Closing as "not our bug". If you disagree, please reopen.

JSON Source