New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 604166 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Investigate possible leak of Bluetooth characteristic/descriptor objects.

Project Member Reported by r...@chromium.org, Apr 17 2016

Issue description

The current implementations for BluetoothRemoteGattServiceBlueZ and BluetoothRemoteGattCharacteristicBlueZ contain maps to the characteristics and descriptors they contain. It seems that the characteristics/descriptors being pointed to in these maps may be getting leaked.

For example,
a.) A descriptor gets discovered on a remote device, the characteristic object gets a call to GattDescriptorAdded. This adds an entry to the descriptors_ map with a newly created BluetoothGattDescriptorBlueZ object.
b.) This descriptor is removed by the remote device, so a GattDescriptorRemoved call gets invoked on the characteristic object. This causes us to remove the entry in the map for the BluetoothGattDescriptorBlueZ object, but we don't delete the object. Instead the object is forwarded to the BluetoothAdapter::Observer::GattDescriptorRemoved function.

As far as I can see, this observer function, in all its implementations, doesn't delete this descriptor object either.


To be fair, this is a very unlikely situation to happen, since this will almost always happen when a remote device is removing a service. It is unlikely that it will that it will just remove one characteristic for a service or or one descriptor from a characteristic. This can happen though and this should be fixed.

 

Comment 1 by mcchou@chromium.org, Apr 18 2016

Cc: mcchou@chromium.org

Comment 2 by ortuno@chromium.org, Apr 25 2016

Components: IO>Bluetooth

Comment 3 by ortuno@chromium.org, Apr 25 2016

Components: -OS>Systems>Bluetooth

Comment 4 by mcchou@chromium.org, May 10 2016

Cc: r...@chromium.org puthik@chromium.org
Owner: mcchou@chromium.org
Status: Started (was: Assigned)

Comment 6 by mcchou@chromium.org, May 14 2016

Indeed, the deletion of the  pointers are handled properly, but the ownership of the pointers stored in CharacteristicMap[1] and DescriptorMap[2] is not clear. Besides, during the removal, the to-be-removed object should not be returned when others calling Getter functions.

[1] https://code.google.com/p/chromium/codesearch#chromium/src/device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.h&q=CharacteristicMap&sq=package:chromium&type=cs&l=105
[2] https://code.google.com/p/chromium/codesearch#chromium/src/device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h&sq=package:chromium&type=cs&l=132&rcl=1463210287

Sign in to add a comment