[TIMOB-2900] Deadlock in app termination for devices that don't support multitasking
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2012-01-26T15:21:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | deadlock, threading |
Reporter | Damien Elmes |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:32:25.000+0000 |
Updated | 2017-03-09T23:10:15.000+0000 |
Description
Titanium is sometimes getting stuck in a deadlock during app shutdown. Originally reported in https://appcelerator.lighthouseapp.com/projects/32238/tickets/2658-crash-on-app-resume"> https://appcelerator.lighthouseapp.com/projects/32238/tickets/2658-... and recently updated with info in this helpdesk ticket: http://developer.appcelerator.com/helpdesk/view/66761">http://developer.appcelerator.com/helpdesk/view/66761
Because the main thread is getting stuck while waiting for the bridge to shut down, modules and the database never get a chance to unload. I have a user with quite a few instances of these deadlocks in his crash logs, and this user is also reporting problems with the database my app uses, so I can't help but wonder whether the unclean shutdown could be related.
I'm attaching three files that demonstrate the deadlock. Terminate.txt contains full debug info showing that the main thread is stuck on NSCondition's waitUntilDate. Terminate2.txt shows the problem occurs on the KitchenSink and not just my app. Terminate* were made with Ti 1.5.1; log2.txt is an older log made with a previous version of Titanium.
Attachments
File | Date | Size |
---|---|---|
anki_2011-01-30-122636_edwinbradfords-iphonecrash.txt | 2011-04-15T03:32:26.000+0000 | 19592 |
anki_2011-01-30-123924_edwinbradfords-iphonecrash.txt | 2011-04-15T03:32:26.000+0000 | 20450 |
log2.txt | 2011-04-15T03:32:26.000+0000 | 22558 |
terminate.txt | 2011-04-15T03:32:26.000+0000 | 19912 |
terminate2.txt | 2011-04-15T03:32:26.000+0000 | 24530 |
I have another user with similar crash reports who is reporting a more serious issue: the app is freezing during normal operation. Since they can't do anything with the app, they hit the home button, and similar crash logs are generated. Attaching two from this new user - one saying the app failed to terminate in time, and one soon after where the app fails to 'resume' when restarted right after (but the user is on 3.1.2)
Reading logs, this should be fixed by #2979.
For in-app deadlocks, scheduled to look at threading in 1.7.
iOS versions which do not support multitasking (<4.0) are no longer supported by Titanium.
Closing ticket as the issue will not fix.