Closed Bug 1246788 Opened 8 years ago Closed 8 years ago

crash in jemalloc_crash | arena_dalloc | mozilla::AndroidBridge::RunDelayedUiThreadTasks

Categories

(Core Graveyard :: Widget: Android, defect)

All
Android
defect
Not set
critical

Tracking

(firefox47 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-74f9f4c4-585d-45b2-bd41-5abbe2160202.
=============================================================

Discussed with :rbarker on IRC, and we think these crashes are caused by race conditions in AndroidBridge::PostTaskToUiThread and AndroidBridge::RunDelayedUiThreadTasks, i.e. access to mDelayedTaskQueue is not synchronized. I think that used to be okay, but now we are using PostTaskToUiThread in several places off of UI thread, so we should synchronize.

We should probably add a lock to synchronize mDelayedTaskQueue access, and make sure to temporarily unlock when running a particular task, so that a task posting another task doesn't cause a deadlock (or use a re-entrant lock).
Assignee: nobody → nchen
Status: NEW → ASSIGNED
I think there's a memory leak too to go with the race condition... The inner
task isn't deleted after it runs in AndroidBridge::RunDelayedUiThreadTasks.

This patch adds proper synchronization to the UI thread task queue so we don't
run into race conditions. It also uses UniquePtr to manage the contained task,
to fix the memory leak.
Attachment #8717637 - Flags: review?(rbarker)
Attachment #8717637 - Flags: review?(rbarker) → review+
https://hg.mozilla.org/mozilla-central/rev/3bf743cb7421
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: