Closed
Bug 1162893
Opened 9 years ago
Closed 9 years ago
[bluetooth2] App crashed after write characteristic
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(firefox41 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: elin, Assigned: brsun)
References
Details
Attachments
(2 files, 1 obsolete file)
https://bugzilla.mozilla.org/show_bug.cgi?id=1161939 After this bug fixed, I rebuilt b2g and tried to write characteristic again, now it crashed with some error logs. I guess these two lines are closest to the root cause? maybe I'm wrong... I/Gecko ( 3696): IPDL protocol error: Error deserializing 'writeType' (BluetoothGattWriteType) member of 'GattClientWriteCharacteristicValueRequest' I/Gecko ( 3696): IPDL protocol error: Error deserializing 'Request' also detail logs are attached.
In addition, here's the code I use to write descriptor: https://github.com/elin-moco/ble-explorer/blob/master/main.js#L531 basically I create the value array the same way as descriptor.writeValue, and my write descriptor code is working fine.
Assignee | ||
Comment 3•9 years ago
|
||
I guess the root cause should be because |ParamTraits| of |BluetoothGattCharAttribute|[1] doesn't pass |mWriteType| during serialization and deserialization[2], so |BluetoothGattCharacteristic::mWriteType|[3] doesn't have chances to have a proper value during its initialization[4]. When |BluetoothGattCharacteristic::WriteValue()|[5] is called, the value validation for |BluetoothGattWriteType|[6] could fail easily due to passing a garbage value. [1] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluetooth2/ipc/BluetoothMessageUtils.h#115 [2] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/BluetoothCommon.h#718 [3] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp#66 [4] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluetooth2/BluetoothGattService.cpp#109 [5] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp#319 [6] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/bluetooth2/ipc/BluetoothMessageUtils.h#41
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8603304 -
Flags: feedback?(elin)
Assignee | ||
Comment 5•9 years ago
|
||
Eddie, Would you help to try the patch on comment 4 to see if it helps or not?
(In reply to Bruce Sun [:brsun] from comment #5) > Eddie, > > Would you help to try the patch on comment 4 to see if it helps or not? OK, I'll try to build with the patch first, and I'll try it on my flame on Monday.
Comment on attachment 8603304 [details] [diff] [review] bug1162893_gatt_characteristic_writetype_serialization.patch Review of attachment 8603304 [details] [diff] [review]: ----------------------------------------------------------------- Hooray!!! I'm able to blink LED and rotate servo through characteristic.writeValue now! Thanks for the patch!
Attachment #8603304 -
Flags: feedback?(elin) → feedback+
Assignee | ||
Updated•9 years ago
|
Attachment #8603304 -
Flags: review?(joliu)
Comment 9•9 years ago
|
||
Comment on attachment 8603304 [details] [diff] [review] bug1162893_gatt_characteristic_writetype_serialization.patch Review of attachment 8603304 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. Thanks for fixing this.
Attachment #8603304 -
Flags: review?(joliu) → review+
Assignee | ||
Comment 10•9 years ago
|
||
Attachment #8603304 -
Attachment is obsolete: true
Attachment #8604006 -
Flags: review+
Attachment #8604006 -
Flags: feedback+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 11•9 years ago
|
||
Files under bluetooth2 is not built/compiled by default for the moment.
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/ddb0bfa1e15a
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•