Closed Bug 755190 Opened 9 years ago Closed 9 years ago

Enabling b2g bluetooth will lead to system crash

Categories

(Core :: DOM: Device Interfaces, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: echou, Assigned: echou)

References

Details

Attachments

(1 file)

Currently if you try to enable Bluetooth, B2G process will restart. The root cause is both BluetoothAdapter.cpp and BluetoothFirmware.cpp includes BluetoothFirmware.h, and that makes static struct object sBluedroidFunctions have individual object in each file. Therefore, it will crash while calling the method of sBluedroidFunctions:

  int isEnabled = sBluedroidFunctions.bt_is_enabled();
  // sBluedroidFunctions here belongs to BluetoothAdapter,
  // not to BluetoothFirmware.
Assignee: nobody → echou
Comment on attachment 623956 [details] [diff] [review]
v1: Fix crash while enabling Bluetooth

Review of attachment 623956 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with nits I caused picked by someone else. :D 

I'll land it in the morning (or at least, my morning) unless you want to mark it with "needs landing"

::: dom/bluetooth/BluetoothFirmware.h
@@ +10,5 @@
>  namespace mozilla {
>  namespace dom {
>  namespace bluetooth {
>  
> +bool EnsureBluetoothInit();

nit that's really my fault: Not that the struct before it had any, but we could probably use some comments here to say when/where Ensure should be called (main thread, before dbus functions are called, etc...)
Attachment #623956 - Flags: review?(kyle) → review+
Thanks, Kyle. 
Then please help to check it in tomorrow morning. :)
Component: DOM → DOM: Device Interfaces
QA Contact: general → device-interfaces
Please can you set the target milestone when landing on inbound. Thank you :-)

https://hg.mozilla.org/mozilla-central/rev/bff01f1a1daf
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.