Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2900] Deadlock in app termination for devices that don't support multitasking

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2012-01-26T15:21:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsdeadlock, threading
ReporterDamien Elmes
AssigneeStephen Tramer
Created2011-04-15T03:32:25.000+0000
Updated2017-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

FileDateSize
anki_2011-01-30-122636_edwinbradfords-iphonecrash.txt2011-04-15T03:32:26.000+000019592
anki_2011-01-30-123924_edwinbradfords-iphonecrash.txt2011-04-15T03:32:26.000+000020450
log2.txt2011-04-15T03:32:26.000+000022558
terminate.txt2011-04-15T03:32:26.000+000019912
terminate2.txt2011-04-15T03:32:26.000+000024530

Comments

  1. Damien Elmes 2011-04-15

    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)

  2. Stephen Tramer 2011-04-15

    Reading logs, this should be fixed by #2979.

  3. Stephen Tramer 2011-04-15

    For in-app deadlocks, scheduled to look at threading in 1.7.

  4. Stephen Tramer 2012-01-26

    iOS versions which do not support multitasking (<4.0) are no longer supported by Titanium.
  5. Lee Morris 2017-03-09

    Closing ticket as the issue will not fix.

JSON Source