Bluetooth does not turn on via gnome-control-center after bluetooth.service crash

Bug #1948990 reported by Fletcher Porter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bluez (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I had bluetooth crash (see logs below). After the crash, I attempted to restart bluetooth by pressing the On/Off switch in the top-right of the Bluetooth tab of gnome-control-center (it was set to off). After pressing the switch, the switch read "On", but the display of Bluetooth devices still appeared as it does when Bluetooth is off (it read "Bluetooth Turned Off\nTurn on to connect devices and receive file transfers.").

I was able to remedy the situation by manually executing `sudo bluetoothd`. I did this while the above On/Off switch was "Off" and the Bluetooth device list said Bluetooth was off. After executing, the Bluetooth device list listed all my Bluetooth devices as expected.

This is with bluetoothd 5.48.

Bluetooth crash logs

```
12:22:15 pulseaudio: (6856.168| 0.576) [pulseaudio] bluez5-util.c: Bluetooth daemon disappeared
12:22:15 systemd: bluetooth.service: Failed with result 'core-dump'.
12:22:15 systemd: bluetooth.service: Failed with result 'core-dump'.
12:22:15 systemd: bluetooth.service: Main process exited, code=dumped, status=11/SEGV
12:22:15 kernel: bluetoothd[816]: segfault at 31 ip 0000562f7fa9bea2 sp 00007ffd0d54b720 error 4 in bluetoothd[562f7fa00000+f3000]
10:28:31 kernel: hid-generic 0005:046D:B019.0007: input,hidraw6: BLUETOOTH HID v0.06 Keyboard [MX Master 2S] on F4:D1:08:9E:7B:85
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
10:28:31 bluetoothd: bt_uhid_send: Invalid argument (22)
```

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gnome-control-center 1:3.28.2-0ubuntu0.18.04.6
Uname: Linux 5.10.0-051000-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.26
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Oct 27 13:00:09 2021
InstallationDate: Installed on 2021-01-04 (295 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Fletcher Porter (fpdotmonkey) wrote :
Revision history for this message
Fletcher Porter (fpdotmonkey) wrote :

Here's a more complete set of logs around the bluetooth crash

```
12:22:15 gnome-shell: JS ERROR: TypeError: monitor is null
_reposition@resource:///org/gnome/shell/ui/boxpointer.js:508:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_allocate@resource:///org/gnome/shell/ui/boxpointer.js:235:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_init/<@resource:///org/gnome/shell/ui/layout.js:210:17

12:22:15 pulseaudio: (6856.168| 0.000) [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
12:22:15 systemd: bluetooth.service: Failed with result 'core-dump'.
12:22:15 kernel: Code: c0 c3 66 0f 1f 44 00 00 31 c0 48 85 ff 74 59 53 48 8b 4f 08 48 89 fb 48 85 c9 74 43 48 3b 31 48 8b 79 08 74 4b 48 85 ff 74 5e <48> 39 37 48 8b 47 08 74 0d 48 89 f9 48 89 c7 eb ea 0f 1f 44 00 00
12:22:15 kernel: bluetoothd[816]: segfault at 31 ip 0000562f7fa9bea2 sp 00007ffd0d54b720 error 4 in bluetoothd[562f7fa00000+f3000]
12:22:15 kernel: show_signal_msg: 5 callbacks suppressed
12:22:15 upowerd: unhandled action 'unbind' on /sys/devices/virtual/misc/uhid/0005:046D:B019.0007
12:22:15 gdm-x-session: (II) systemd-logind: releasing fd for 13:87
12:22:15 gnome-shell: g_array_unref: assertion 'array' failed
12:22:15 gdm-x-session: (II) event23 - MX Master 2S Mouse: device removed
12:22:15 gdm-x-session: (II) event23 - MX Master 2S Mouse: device removed
12:22:15 gdm-x-session: (**) Option "fd" "72"
12:22:15 gdm-x-session: (II) config/udev: removing device MX Master 2S Mouse
12:22:15 gnome-shell: g_array_unref: assertion 'array' failed
12:22:15 gdm-x-session: (II) systemd-logind: releasing fd for 13:86
12:22:15 gdm-x-session: (II) systemd-logind: releasing fd for 13:86
12:22:15 gdm-x-session: (II) UnloadModule: "libinput"
12:22:15 gdm-x-session: (II) event22 - MX Master 2S Keyboard: device removed
12:22:15 gdm-x-session: (**) Option "fd" "60"
12:22:15 gdm-x-session: (II) config/udev: removing device MX Master 2S Keyboard
12:22:15 acpid: input device has been disconnected, fd 22
12:22:14 gnome-shell: JS ERROR: TypeError: monitor is null
_reposition@resource:///org/gnome/shell/ui/boxpointer.js:508:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_allocate@resource:///org/gnome/shell/ui/boxpointer.js:235:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_init/<@resource:///org/gnome/shell/ui/layout.js:210:17

12:22:14 pulseaudio: (6855.591| 86.788) [pulseaudio] bluez5-util.c: Properties changed in device /org/bluez/hci0/dev_E8_F7_90_05_99_E4
```

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I don't think the GUI is meant to start bluetoothd at all. It only toggles the power state of the Bluetooth hardware. It assumes bluetoothd is always running. So failure to restart after a crash is a problem with bluez's systemd scripting.

affects: gnome-control-center (Ubuntu) → bluez (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It appears BlueZ upstream does not restart on failure, but in Ubuntu we turned on restart-on-failure in version 5.53-0ubuntu3. I suggest the best way to get that fix right now is to upgrade to Ubuntu 20.04.

Changed in bluez (Ubuntu):
status: New → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

You can also apply the fix manually be editing /lib/systemd/system/bluetooth.service and changing:

  #Restart=on-failure

to

  Restart=on-failure

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.