New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As of 5.73: rfkill block bluetooth
puts bluetoothd
in loop at 100% CPU.
#785
Comments
If my The loop at: Line 7521 in 87cabb2
becomes infinite. This test inside Line 7489 in 87cabb2
always returns Line 7492 in 87cabb2
|
Reverting 44d3f67 fixes this. |
This checks if there is any service connected on device_is_connected since some profiles maybe probed using advertising data which doesn't require a connection.
Issue replicated on endeavourOS 6.8.1-arch1-1, bluez 5.73. Exactly same behaviour |
Afaik this was fixed in 8060d12 |
@pv unfortunately running either 8060d12 or current
diff --git a/src/device.c b/src/device.c
index 5e74633c6..de5f94c7d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3273,11 +3273,7 @@ uint8_t btd_device_get_bdaddr_type(struct btd_device *dev)
bool btd_device_is_connected(struct btd_device *dev)
{
- if (dev->bredr_state.connected || dev->le_state.connected)
- return true;
-
- return find_service_with_state(dev->services,
- BTD_SERVICE_STATE_CONNECTED);
+ return dev->bredr_state.connected || dev->le_state.connected;
}
static void clear_temporary_timer(struct btd_device *dev) resolves the issue. |
|
@dimitris-personal, did you want to open a PR for your patch above, so that it can be officially reviewed/committed? |
Created a PR #802 |
Just for reference, and since github PRs are not the official change submission channel (can you tell I'm a newbie in this?), I've submitted an updated, narrower change in the mailing list. Both changes are in this thread, this narrower one is in the V2 part of the thread: diff --git a/src/adapter.c b/src/adapter.c
index 4bcc464de..0b7aab4b5 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7486,7 +7486,7 @@ static void adapter_remove_connection(struct btd_adapter *adapter,
device_cancel_authentication(device, TRUE);
/* If another bearer is still connected */
- if (btd_device_is_connected(device))
+ if (btd_device_state_is_connected(device))
return;
adapter->connections = g_slist_remove(adapter->connections, device);
diff --git a/src/device.c b/src/device.c
index 5e74633c6..123b1b796 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3273,13 +3273,18 @@ uint8_t btd_device_get_bdaddr_type(struct btd_device *dev)
bool btd_device_is_connected(struct btd_device *dev)
{
- if (dev->bredr_state.connected || dev->le_state.connected)
+ if (btd_device_state_is_connected(dev))
return true;
return find_service_with_state(dev->services,
BTD_SERVICE_STATE_CONNECTED);
}
+bool btd_device_state_is_connected(struct btd_device *dev)
+{
+ return dev->bredr_state.connected || dev->le_state.connected;
+}
+
static void clear_temporary_timer(struct btd_device *dev)
{
if (dev->temporary_timer) {
diff --git a/src/device.h b/src/device.h
index d4e70b7ef..e3191f2a4 100644
--- a/src/device.h
+++ b/src/device.h
@@ -104,6 +104,7 @@ void device_set_rssi(struct btd_device *device, int8_t rssi);
void device_set_tx_power(struct btd_device *device, int8_t tx_power);
void device_set_flags(struct btd_device *device, uint8_t flags);
bool btd_device_is_connected(struct btd_device *dev);
+bool btd_device_state_is_connected(struct btd_device *dev);
uint8_t btd_device_get_bdaddr_type(struct btd_device *dev);
bool device_is_retrying(struct btd_device *device);
void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type, |
Thank you @dimitris-personal ! |
Summary: With at least one device connected, disabling bluetooth (e.g. airplane mode) gets stuck and never completes, requires a SIGKILL to
bluetoothd
.This happens with the current latest code in
master
at 87cabb2 and also at the most recent release, 5.73.Steps to reproduce
rfkill block bluetooth
bluetoothd
takes a whole core, GNOME quick settings and status still shows bluetooth as "active". I have tokill -9
the process to get theblock
to really complete.While pegging the CPU, this seems to be the stack (this is with the second of the builds above):
The text was updated successfully, but these errors were encountered: