The default bug view has changed. See this FAQ.

Enabling b2g bluetooth will lead to system crash

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: ericchou, Assigned: ericchou)

Tracking

unspecified
mozilla15
All
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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)

Updated

5 years ago
Assignee: nobody → echou
(Assignee)

Comment 1

5 years ago
Created attachment 623956 [details] [diff] [review]
v1: Fix crash while enabling Bluetooth
Attachment #623956 - Flags: review?(kyle)
(Assignee)

Updated

5 years ago
Blocks: 727618
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+
(Assignee)

Comment 3

5 years ago
Thanks, Kyle. 
Then please help to check it in tomorrow morning. :)
Component: DOM → DOM: Device Interfaces
QA Contact: general → device-interfaces
http://hg.mozilla.org/integration/mozilla-inbound/rev/bff01f1a1daf
Please can you set the target milestone when landing on inbound. Thank you :-)

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