LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   bluetoothd crashes after attempt to reconnect in -current (https://www.linuxquestions.org/questions/slackware-14/bluetoothd-crashes-after-attempt-to-reconnect-in-current-4175736104/)

sombragris 04-16-2024 04:29 PM

bluetoothd crashes after attempt to reconnect in -current
 
I got a Bluetooth keyboard that disconnects itself after a period of inactivity.

Someone rang the doorbell at home, I went to see who it was, and when I came back the screen was locked (after the timeout) as usual, but there was no way that my keyboard would reconnect.

After I unlocked Plasma, it became apparent that the Bluetooth daemon was no longer running. After passing
Code:

/etc/rc.d/rc.bluetooth restart
to the root console, I was able to use my keyboard again.

The only clue I got were these two lines at /var/log/messages:

Code:

apple 0005:05AC:024F.0009: input,hidraw5: BLUETOOTH HID v1.06 Keyboard [Keychron K10] on 30:24:32:bb:23:ac

bluetoothd[1218]: segfault at 38 ip 00000000004a3ade sp 00007ffffdb33790 error 4 in bluetoothd (deleted)[407000+cb000] likely on CPU 2 (core 2, socket 0)

So it seems that the computer goes idle, the Bluetooth keyboard gets disconnected, and when it attempts to reconnect, bluetoothd segfaults.

Did anyone else noticed this issue? Any hints on a workaround?

I began to see this just after the updates of last week.

EDIT: Even after today's update to bluez, the issue persists.

litelinux 04-17-2024 08:58 AM

Hi,

Maybe adding the file mentioned in this comment would help:

https://www.linuxquestions.org/quest...9/#post6495638

If not try adding

Code:

/etc/rc.d/rc.bluetooth restart
in the "post" section, under "done".

-- ltlnx

sombragris 04-17-2024 10:24 AM

Quote:

Originally Posted by litelinux (Post 6496627)
Hi,

Maybe adding the file mentioned in this comment would help:

https://www.linuxquestions.org/quest...9/#post6495638

If not try adding

Code:

/etc/rc.d/rc.bluetooth restart
in the "post" section, under "done".

-- ltlnx

Thanks for the suggestion.

However, my system did not go to sleep/hybernate. The screen was just locked out, but otherwise the system was fully active. The laptop was on AC power and the inactivity was of just a few minutes.

Will keep looking for options.

sombragris 04-20-2024 04:52 PM

Unfortunately, even after the latest updates and the reversal of elogind to 252, I'm still experiencing this issue. I now have to keep open a root terminal just for restarting bluetoothd after crashing.

UPDATE: After some thinking it seems that the culprit is bluez. I'm downgrading to 5.73 to see if this fixes the issue. I didn't want to use 5.74 since it lasted only two days and then it was replaced by 5.75. Let's see what happens.

mickski56 04-24-2024 06:20 AM

Probably this https://github.com/bluez/bluez/issues/815. The good news is the fix is in, so 5.76 should fix it.

sombragris 04-25-2024 06:24 AM

Quote:

Originally Posted by mickski56 (Post 6498045)
Probably this https://github.com/bluez/bluez/issues/815. The good news is the fix is in, so 5.76 should fix it.

Thanks for the info. This is consistent with my experience. I will wait for the fix, since my patching abilities are not that good.

Meanwhile, I can confirm that:
  • The issue still persists here after the latest -current changes; and
  • reverting to bluez-5.73 makes the issue disappear.

Therefore, barring an upcoming update, I respectfully request for bluez to be reverted to 5.73 until a suitable fix appears. Thanks!!

titopoquito 04-25-2024 09:44 AM

Quote:

Originally Posted by sombragris (Post 6498196)
Thanks for the info. This is consistent with my experience. I will wait for the fix, since my patching abilities are not that good.

Meanwhile, I can confirm that:
  • The issue still persists here after the latest -current changes; and
  • reverting to bluez-5.73 makes the issue disappear.

Therefore, barring an upcoming update, I respectfully request for bluez to be reverted to 5.73 until a suitable fix appears. Thanks!!

In case you want to try the patch follow the following steps:
  • Go to the github page concerning the bug. In the second last message you see the commit hash with the fix. Click it, then in the URL bar of your browser add ".patch" and you will get the patch in unified diff format. The URL should read https://github.com/bluez/bluez/commi...234c6dea.patch
  • Download the source for bluez. 'lftp -c "open https://mirrors.slackware.com/slackw...ent/source/n/; mirror bluez"' (remove the single quotes)
  • cd to the downloaded bluez folder, copy or move the downloaded patch in this folder
  • Edit the bluez.SlackBuild. I would suggest you add a line right after the line "cd $PKGNAM-$VERSION || exit 1". Make the line look like "patch -p1 < b94f1be656f34ea1363f5566ef63b847234c6dea.patch"
  • Execute the SlackBuild, the package will be put in /tmp.
  • upgradepkg --reinstall /tmp/bluez-5.75-x86_64-2.txz
  • Yes, it's that easy :-)
  • Voilą!

sombragris 04-25-2024 05:05 PM

In today's ChangeLog:

Code:

n/bluez-5.75-x86_64-3.txz: Rebuilt.
      [PATCH] shared/uhid: Fix crash if bt_uhid_destroy free replay structure.
      Thanks to sombragris.

Thanks! I will check it out and hopefully this issue will go away. If it does, I'll mark the thread as solved.

sombragris 04-26-2024 04:11 PM

So far Bluetooth reconnect works again and no segfaults were apparent so far after upgrading to the patched bluez. So I'm marking this tentatively as solved.

Thank you Pat. Also thank you a lot @titopoquito for your instrctions regarding patching. I had no opportunity to apply them but they are very easy to follow and approachable.


All times are GMT -5. The time now is 05:24 PM.