Bluetoothd uses 100% of a CPU thread

Bug #1871695 reported by Isaac Cohen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bluez (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

Hi,

I have a bluetooth keyboard that I use for my laptop, which runs Kubuntu 19.04. I noticed though, that a short while after connecting the keyboard, the CPU fan goes on and one of the threads is at 100%. If I open a terminal and type "top", it shows that a process called bluetoothd is taking 12% of the CPU power which is a full thread (100/8=12.5). I'm not sure what it's doing, but it doesn't require that much CPU power to work. If I end the process and restart it, the keyboard works fine and the CPU is calm until it happens again (about 20 minutes later). I reinstalled bluez and even tried recompiling from source, but the problem persists.

My specs:

Version of bluetoothd: 5.50
Linux Kernel: 5.3.0-46-generic
KDE Plasma Version 5.16.5

Thank you,
Isaac Cohen
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu8.8
Architecture: amd64
CurrentDesktop: KDE
DistroRelease: Ubuntu 19.10
InstallationDate: Installed on 2019-12-15 (115 days ago)
InstallationMedia: Kubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
InterestingModules: rfcomm bnep btusb bluetooth
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 003: ID 0c45:671e Microdia Integrated_Webcam_HD
 Bus 001 Device 002: ID 27c6:5301 HTMicroelectronics Goodix Fingerprint Device
 Bus 001 Device 004: ID 0cf3:e009 Qualcomm Atheros Communications
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: Dell Inc. Inspiron 3583
Package: bluez 5.50-0ubuntu5.1 [modified: lib/systemd/system/bluetooth.service lib/udev/hid2hci lib/udev/rules.d/97-hid2hci.rules]
PackageArchitecture: amd64
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.3.0-46-generic root=UUID=dad855bd-aa2f-4675-a8a6-6fa960525f41 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 5.3.0-46.38-generic 5.3.18
Tags: eoan
Uname: Linux 5.3.0-46-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 05/30/2019
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.5.1
dmi.board.name: 0WHCP7
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 10
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr1.5.1:bd05/30/2019:svnDellInc.:pnInspiron3583:pvr:rvnDellInc.:rn0WHCP7:rvrA00:cvnDellInc.:ct10:cvr:
dmi.product.family: Inspiron
dmi.product.name: Inspiron 3583
dmi.product.sku: 08CA
dmi.sys.vendor: Dell Inc.
hciconfig:
 hci0: Type: Primary Bus: USB
  BD Address: AC:D5:64:CC:54:D6 ACL MTU: 1024:8 SCO MTU: 50:8
  UP RUNNING PSCAN ISCAN
  RX bytes:47194 acl:2390 sco:0 events:266 errors:0
  TX bytes:3046 acl:50 sco:0 commands:163 errors:0
mtime.conffile..etc.dbus-1.system.d.bluetooth.conf: 2020-04-07T16:35:14.446062

Isaac Cohen (icohen2000)
affects: ubuntu-manpage-repository → bluez (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Could you add your 'journalctl -b 0' from a session having the issue?

Could you also do 'apport-collect 1871695' to include debug logs to the report?

Changed in bluez (Ubuntu):
status: New → Incomplete
Revision history for this message
Isaac Cohen (icohen2000) wrote : CurrentDmesg.txt

apport information

tags: added: apport-collected eoan
description: updated
Revision history for this message
Isaac Cohen (icohen2000) wrote : Dependencies.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : Lspci.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : ProcEnviron.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : ProcModules.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : UdevDb.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : getfacl.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : modified.conffile..etc.dbus-1.system.d.bluetooth.conf.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : rfkill.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote : syslog.txt

apport information

Revision history for this message
Isaac Cohen (icohen2000) wrote :

Hi,

I attached a file with the output of journalctl -b 0. I also ran the other command, though I'm not sure what it did. It asked for access to launchpad and then if it should send a report to the developers. I clicked "Send", but I don't know how Apport works or where it sends the info.

Regards,
Isaac Cohen

Revision history for this message
Isaac Cohen (icohen2000) wrote :

Oh, I see the apport information now.

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

I would like to see a stack trace of the busy bluetoothd process, which means killing it in a way that it will dump core and create a crash report. But that won't work right now because of bug 1870060.

Intead, please attach 'gdb' (run it as root) to the busy bluetoothd process and then run 'bt' in gdb to get a backtrace.

Revision history for this message
Isaac Cohen (icohen2000) wrote :
Download full text (3.7 KiB)

Hi,

Here is what I got:

isaac@isaac-Inspiron-3583:~$ sudo gdb
GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) attach 794
Attaching to process 794
Reading symbols from target:/usr/local/libexec/bluetooth/bluetoothd...
Reading symbols from target:/lib/x86_64-linux-gnu/libglib-2.0.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libglib-2.0.so.0)
Reading symbols from target:/lib/x86_64-linux-gnu/libdbus-1.so.3...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libdbus-1.so.3)
Reading symbols from target:/lib/x86_64-linux-gnu/libdl.so.2...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/libc-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/libpcre.so.3...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libpcre.so.3)
Reading symbols from target:/lib/x86_64-linux-gnu/libpthread.so.0...
Reading symbols from /usr/lib/debug/.build-id/7f/4107df84da625f1b445ade877e1e0ab6ba823d.debug...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from target:/lib/x86_64-linux-gnu/libsystemd.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libsystemd.so.0)
Reading symbols from target:/lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in target:/lib64/ld-linux-x86-64.so.2)
Reading symbols from target:/lib/x86_64-linux-gnu/librt.so.1...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/librt-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/liblzma.so.5...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/liblzma.so.5)
Reading symbols from target:/lib/x86_64-linux-gnu/liblz4.so.1...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/liblz4.so.1)
Reading symbols from target:/lib/x86_64-linux-gnu/libgcrypt.so.20...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libgcrypt.so.20)
Reading symbols from target:/lib/x86_64-linux-gnu/libgpg-error.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libgpg-error.so.0)
--Type <RET> for more, q to quit, c to continue without paging--
0x00007f5bd69fbbf7 in __GI___poll (fds=0x55e26e5504c0, nfds=29, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
29 ../sysdeps/unix/sysv/linux/poll.c: No such file or directory.
(gdb) bt
#0 0x00007f5bd69fbbf7 in __GI_...

Read more...

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

Thanks but that appears to be an idle thread so maybe we need to look at the other threads, if any. Please try this command in gdb:

  thread apply all bt

and send us the output.

Revision history for this message
Isaac Cohen (icohen2000) wrote :
Download full text (4.3 KiB)

Now I get this:

isaac@isaac-Inspiron-3583:~$ sudo gdb
[sudo] password for isaac:
GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) attach 794
Attaching to process 794
Reading symbols from target:/usr/local/libexec/bluetooth/bluetoothd...
Reading symbols from target:/lib/x86_64-linux-gnu/libglib-2.0.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libglib-2.0.so.0)
Reading symbols from target:/lib/x86_64-linux-gnu/libdbus-1.so.3...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libdbus-1.so.3)
Reading symbols from target:/lib/x86_64-linux-gnu/libdl.so.2...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/libc-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/libpcre.so.3...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libpcre.so.3)
Reading symbols from target:/lib/x86_64-linux-gnu/libpthread.so.0...
Reading symbols from /usr/lib/debug/.build-id/7f/4107df84da625f1b445ade877e1e0ab6ba823d.debug...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from target:/lib/x86_64-linux-gnu/libsystemd.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libsystemd.so.0)
Reading symbols from target:/lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in target:/lib64/ld-linux-x86-64.so.2)
Reading symbols from target:/lib/x86_64-linux-gnu/librt.so.1...
Reading symbols from target:/usr/lib/debug//lib/x86_64-linux-gnu/librt-2.30.so...
Reading symbols from target:/lib/x86_64-linux-gnu/liblzma.so.5...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/liblzma.so.5)
Reading symbols from target:/lib/x86_64-linux-gnu/liblz4.so.1...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/liblz4.so.1)
Reading symbols from target:/lib/x86_64-linux-gnu/libgcrypt.so.20...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libgcrypt.so.20)
Reading symbols from target:/lib/x86_64-linux-gnu/libgpg-error.so.0...
(No debugging symbols found in target:/lib/x86_64-linux-gnu/libgpg-error.so.0)
--Type <RET> for more, q to quit, c to continue without paging--
0x00007f888e505f66 in g_main_context_prepare () from target:/lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) thread apply all bt

Thread 1 (Thread 0x7f888df97c00 (LWP 794)):
#0 0x00007f888e505f66 in g_main_context_p...

Read more...

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

Thanks. This sounds kind of like bug 1717796 so that is now reopened. It's also active with the upstream developers.

Revision history for this message
Wang Xuancong (xuancong84) wrote :

The same bug occurs on Raspberry Pi and Mac OS, I think it is an open-source bluetooth bug.

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.