Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15544] iOS7: info.plist key 'Application does not run in background' causes the application to crash when is set to 'YES'

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-12-27T23:15:56.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 26, 2013 Sprint 26 API, Release 3.2.1, Release 3.3.0
ComponentsiOS
Labelsmodule_titanium, module_xcodebuild, qe-testadded, regression, supportTeam, triage
ReporterRupesh Sharma
AssigneeSabil Rahim
Created2013-10-21T11:43:18.000+0000
Updated2014-07-31T08:51:11.000+0000

Description

Description

Attached is a very simple multiple context app using the info.plist key 'Application does not run in background' key set to 'YES'. It crashes after < 10 open/closes of app. Note: Issue is reproducible only in 3.1.3GA.

Test Case

Please find the attached project that reproduces the issue. Try to open/close the application for less than 10 times and then you are able to reproduce the issue.

Attachments

FileDateSize
testApp.zip2013-10-21T11:43:18.000+00001408708

Comments

  1. Ingo Muschenetz 2013-10-21

    [~rsharma] You indicate it's only reproducible in 3.1.3.GA. What other SDKs did you try? Does it only happen on iOS 7?
  2. Ingo Muschenetz 2013-10-22

    Does it matter how fast you open and close the app? Is it in the space of one minute? Or across an hour?
  3. Priya Agarwal 2013-12-16

    Tested Environment: Appcelerator Studio: 3.2.0.201312151544 SDK:3.2.0.v20131215211321 alloy: 1.3.0-cr acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr3 titanium-code-processor: 1.1.0-cr2 Xcode:5.0.2 OS: Mac OSX 10.9 Device: Iphone5(v7.0.4),Ipod Touch3(v6.1.3) Hope my findings help: I could see the strange behavior that app crash(not visible to us) instead it just generates the crash logs. App crash(not visible to us) has a reason that info plist has key 'Application does not run in background' set to 'YES'. Hence app always relaunches itself from start. Steps to reproduce: 1)Import the test app attached and run on iOS Device. 2)Tap on any tab. Respective window gets open. 3)Press Home button. So that app gets terminated(as because info plist has key ‘Application does not run’ in background set to true). 4)Now when again I launch the app the app gets restarted and launch itself. But the app throws crash logs as:
       
       Dec 16 13:55:29 GL-iPhone5 AKLeg[1547] <Warning>: [ERROR] Can not close root window of the tab. Use removeTab instead
       Dec 16 13:55:29 GL-iPhone5 AKLeg[1547] <Warning>: [ERROR] Can not close root window of the tab. Use removeTab instead
       Dec 16 13:55:29 GL-iPhone5 AKLeg[1547] <Warning>: [ERROR] Can not close root window of the tab. Use removeTab instead
       Dec 16 13:55:29 GL-iPhone5 AKLeg[1547] <Warning>: [ERROR] The application has crashed with an uncaught exception 'org.akleg.TiUITabProxy'.
       	Reason:
       	Invalid type passed to function
       	Stack trace:
       	
       	0   CoreFoundation                      0x2d96ce83 <redacted> + 130
       	1   libobjc.A.dylib                     0x37cc96c7 objc_exception_throw + 38
       	2   AKLeg                               0x00181bb9 AKLeg + 760761
       	3   AKLeg                               0x0016a8b1 AKLeg + 665777
       	4   AKLeg                               0x00153c5d AKLeg + 572509
       	5   AKLeg                               0x00154467 AKLeg + 574567
       	6   AKLeg                               0x001541ef AKLeg + 573935
       	7   AKLeg                               0x001551f7 AKLeg + 578039
       	8   AKLeg                               0x00182963 AKLeg + 764259
       	9   AKLeg                               0x00182341 AKLeg + 762689
       	10  AKLeg                               0x001551b9 AKLeg + 577977
       	11  AKLeg                               0x001eea93 AKLeg + 1206931
       	12  AKLeg                               0x00141bd3 AKLeg + 498643
       	13  AKLeg                               0x00182963 AKLeg + 764259
       	14  AKLeg                               0x00182d63 AKLeg + 765283
       	15  AKLeg                               0x001c9d63 AKLeg + 1056099
       	16  AKLeg                               0x001c9f4f AKLeg + 1056591
       	17  UIKit                               0x3017809d <redacted> + 152
       	18  UIKit                               0x30175497 <redacted> + 2474
       	19  UIKit                               0x300f60c7 <redacted> + 774
       	20  UIKit                               0x300f5cfd <redacted> + 72
       	21  UIKit                               0x3015b321 <redacted> + 664
       	22  GraphicsServices                    0x325db76d <redacted> + 608
       	23  GraphicsServices                    0x325db357 <redacted> + 34
       	24  CoreFoundation                      0x2d937777 <redacted> + 34
       	25  CoreFoundation                      0x2d937713 <redacted> + 346
       	26  CoreFoundation                      0x2d935edf <redacted> + 1406
       	27  CoreFoundation                      0x2d8a0471 CFRunLoopRunSpecific + 524
       	28  CoreFoundation                      0x2d8a0253 CFRunLoopRunInMode + 106
       	29  GraphicsServices                    0x325da2eb GSEventRunModal + 138
       	30  UIKit                               0x30155845 UIApplicationMain + 1136
       	31  AKLeg                               0x000d050f AKLeg + 34063
       	32  libdyld.dylib                       0x381c2ab7 <redacted> + 2
       Dec 16 13:55:29 GL-iPhone5 AKLeg[1547] <Error>: *** Terminating app due to uncaught exception 'org.akleg.TiUITabProxy', reason: 'Invalid type passed to function'
       	*** First throw call stack:
       	(0x2d96ce83 0x37cc96c7 0x181bb9 0x16a8b1 0x153c5d 0x154467 0x1541ef 0x1551f7 0x182963 0x182341 0x1551b9 0x1eea93 0x141bd3 0x182963 0x182d63 0x1c9d63 0x1c9f4f 0x3017809d 0x30175497 0x300f60c7 0x300f5cfd 0x3015b321 0x325db76d 0x325db357 0x2d937777 0x2d937713 0x2d935edf 0x2d8a0471 0x2d8a0253 0x325da2eb 0x30155845 0xd050f 0x381c2ab7)
       Dec 16 13:55:29 GL-iPhone5 ReportCrash[1548] <Notice>: ReportCrash acting against PID 1547
       Dec 16 13:55:29 GL-iPhone5 ReportCrash[1548] <Notice>: Formulating crash report for process AKLeg[1547]
       Dec 16 13:55:29 GL-iPhone5 com.apple.launchd[1] (UIKitApplication:org.akleg.iphoneapp[0xeb72][1547]) <Warning>: (UIKitApplication:org.akleg.iphoneapp[0xeb72]) Job appears to have crashed: Abort trap: 6
       Dec 16 13:55:29 GL-iPhone5 backboardd[28] <Warning>: Application 'UIKitApplication:org.akleg.iphoneapp[0xeb72]' exited abnormally with signal 6: Abort trap: 6
       Dec 16 13:55:29 GL-iPhone5 ReportCrash[1548] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/AKLeg_2013-12-16-135529_GL-iPhone5.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
       
    The above scenario is reproduced in latest sdk build:3.2.0.v20131215211321 as well as on 3.1.3.GA on both iOS6 and 7 devices. But using 3.1.2.GA no crash logs are generated instead just gets a warning :
       [WARN] Can not close root window of a tab. Use TabGroup.removeTab instead
       
  4. Sabil Rahim 2013-12-16

    Alright looks like a bug we introduced as part of windows refactor. (3.1.3) Turns out in TiUITabProxy.m ; closeWindowProxy:animated: method when it trys to find the navigationController. the rootWindow is nil and is no longer a type of TiWindowProxy causing the crash.
  5. Sabil Rahim 2013-12-27

    MASTER PR : https://github.com/appcelerator/titanium_mobile/pull/5166
  6. Sabil Rahim 2013-12-30

    32X PR https://github.com/appcelerator/titanium_mobile/pull/5175
  7. Wilson Luu 2014-01-07

    Closing ticket as fixed. Verified, using the attached sample app, that the app does not silently crash after pressing the home button. Tested on: Appcelerator Studio, build: 3.2.1.201401052158 SDK build: 3.2.1.v20140106134045, 3.3.0.v20140106141645 CLI: 3.2.0 Alloy: 1.3.1-beta Xcode: 5.0.2 Devices: iphone 4s (6.0.1), iphone 5s (7.0.2)

JSON Source