Closed
Bug 782905
Opened 12 years ago
Closed 12 years ago
[b2g-bluetooth] Calling setEnabled(false) twice in a very short period may crash
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: echou, Assigned: echou)
Details
Attachments
(1 file)
913 bytes,
patch
|
qdot
:
review+
|
Details | Diff | Splinter Review |
Evelyn found a bug: If BluetoothManager.setEnabled(false) is called twice almost at the same time, it may lead to system crash. I've checked and found the root cause. In class ToggleBtAck, we try to shutdown gBluetoothService->mBluetoothCommandThread. When the second setEnabled(false) is called, mBluetoothCommandThread may have been swapped by the first setEnabled, which means that gBluetoothService->mBluetoothCommandThread will be null. The easiest and efficient way to solve this is to add an if-statement to ensure mBluetoothCommandThread is not null.
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → echou
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #652056 -
Flags: review?(kyle)
Comment 2•12 years ago
|
||
Comment on attachment 652056 [details] [diff] [review] v1: Check if mBluetoothCommandThread is null Review of attachment 652056 [details] [diff] [review]: ----------------------------------------------------------------- r=me, I think this should work, though we should probably have bent take a look at this before it lands since this is totally a regression I caused when we landed 768306, where I removed the reference counting. :/
Attachment #652056 -
Flags: review?(kyle)
Attachment #652056 -
Flags: review+
Attachment #652056 -
Flags: feedback?(bent.mozilla)
Comment 3•12 years ago
|
||
Comment on attachment 652056 [details] [diff] [review] v1: Check if mBluetoothCommandThread is null Ok, bent's out this week, and I'm mostly sure this should work at least for the moment. Will file a followup to talk to bent about this when he gets back. Landable for now.
Attachment #652056 -
Flags: feedback?(bent.mozilla)
Assignee | ||
Comment 4•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/cb192b83831c
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cb192b83831c
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•