Bug 325364 - Seg Fault when connecting bluetooth headset
Summary: Seg Fault when connecting bluetooth headset
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: bluetooth (show other bugs)
Version: 2.0.0
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords: drkonqi
: 325943 326110 327072 327132 327564 327584 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-27 14:42 UTC by Christian Gomez
Modified: 2014-01-02 17:47 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (1.15 KB, text/plain)
2013-10-22 16:45 UTC, oliver.zemann
Details
New crash information added by DrKonqi (1.14 KB, text/plain)
2013-11-09 18:19 UTC, oliver.zemann
Details
New crash information added by DrKonqi (1.11 KB, text/plain)
2013-12-01 23:09 UTC, Junji Shimagaki
Details
New crash information added by DrKonqi (1.11 KB, text/plain)
2013-12-01 23:09 UTC, Junji Shimagaki
Details
New crash information added by DrKonqi (2.61 KB, text/plain)
2013-12-03 14:02 UTC, mps
Details
New crash information added by DrKonqi (1.04 KB, text/plain)
2013-12-05 18:02 UTC, ark.sega
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Gomez 2013-09-27 14:42:24 UTC
Application: bluedevil-audio (2.0.0)
KDE Platform Version: 4.11.1
Qt Version: 4.8.5
Operating System: Linux 3.11.2-1-ARCH x86_64
Distribution: "Arch Linux"

-- Information about the crash:
- What I was doing when the application crashed:

Attempted to pair my bluetooth headset via the right click menu > device > audio sink connect and I was greeted with a seg fault error.

This happens every time I attempt to connect to either audio sink or headset service. I'm using the latest pulseaudio from git that has a dependency for bluez5

The crash can be reproduced every time.

-- Backtrace:
Application: Bluetooth Audio Helper (bluedevil-audio), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[KCrash Handler]
#5  BlueDevil::Device::isPaired (this=this@entry=0x0) at /tmp/yaourt-tmp-techwiz/aur-libbluedevil-bluez5-git/src/libbluedevil/bluedevil/bluedevildevice.cpp:203
#6  0x00000000004030d8 in AudioHelper::AudioHelper (this=0x1e8bbe0, address=...) at /tmp/yaourt-tmp-techwiz/aur-bluedevil-bluez5-git/src/bluedevil/src/actionplugins/audio/helper/audiohelper.cpp:41
#7  0x0000000000402a10 in main (argc=2, argv=0x7fffc21b8a28) at /tmp/yaourt-tmp-techwiz/aur-bluedevil-bluez5-git/src/bluedevil/src/actionplugins/audio/helper/main.cpp:49

Reported using DrKonqi
Comment 1 Jekyll Wu 2013-10-13 00:54:30 UTC
*** Bug 325943 has been marked as a duplicate of this bug. ***
Comment 2 Jekyll Wu 2013-10-17 02:03:21 UTC
*** Bug 326110 has been marked as a duplicate of this bug. ***
Comment 3 oliver.zemann 2013-10-22 16:45:22 UTC
Created attachment 83028 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.2 using Qt 4.8.5

- What I was doing when the application crashed:

same as the poster did - simply try to connect to the device
there is no workaround, this is real pain in the a** :(

-- Backtrace (Reduced):
#6  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil-2.0/bluedevil/bluedevildevice.cpp:203
#7  0x0000000000402dfe in AudioHelper::AudioHelper (this=0x88a160, address=...) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/audiohelper.cpp:41
#8  0x0000000000402aa1 in main (argc=2, argv=0x7fff9db26bc8) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/main.cpp:49
Comment 4 Jekyll Wu 2013-11-03 11:29:29 UTC
*** Bug 327072 has been marked as a duplicate of this bug. ***
Comment 5 Jekyll Wu 2013-11-04 15:31:41 UTC
*** Bug 327132 has been marked as a duplicate of this bug. ***
Comment 6 oliver.zemann 2013-11-09 18:19:26 UTC
Created attachment 83459 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.3 using Qt 4.8.5

- What I was doing when the application crashed:

Just did an update, in the hope this is fixed. But still the same behaviour. Very bad :(

-- Backtrace (Reduced):
#6  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil-2.0/bluedevil/bluedevildevice.cpp:203
#7  0x0000000000402dfe in AudioHelper::AudioHelper (this=0xda8120, address=...) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/audiohelper.cpp:41
#8  0x0000000000402aa1 in main (argc=2, argv=0x7fff1e695ad8) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/main.cpp:49
Comment 7 Jekyll Wu 2013-11-14 00:58:50 UTC
*** Bug 327564 has been marked as a duplicate of this bug. ***
Comment 8 Jekyll Wu 2013-11-14 07:01:09 UTC
*** Bug 327584 has been marked as a duplicate of this bug. ***
Comment 9 Manfred Kitzbichler 2013-11-25 13:46:57 UTC
*** This bug has been confirmed by popular vote. ***
Comment 10 Manfred Kitzbichler 2013-11-28 15:46:14 UTC
The problem seems to be that "device" points to 0x0 because the codeline in AudioHelper that is supposed to get a pointer to the device from its BlueTooth MAC address fails. That's because the MAC address is stored in a KUrl structure which implicitly converts it to lowercase but the function which indexes the devices expects a MAC address with all capitals (so 1F:00:3C ... instead of 1f:00:3c ...). I tried to patch the respective function "Adapter::deviceForAddress" to convert its argument to uppercase automatically which actually avoids the crash. Sadly it still doesn't seem to result in a connected device though. Somehow the connection attempt still fails further down the road.
Comment 11 Junji Shimagaki 2013-12-01 23:09:14 UTC
Created attachment 83869 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.2 using Qt 4.8.5

- What I was doing when the application crashed:

My bluetooth device is somehow recognizable (Bose Sound Link Mobile Speaker)

Now Click Bluetooth --> "Bose Sound Link .." --> Connect

And crashed

-- Backtrace (Reduced):
#6  0xb72b4a24 in BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil/bluedevil/bluedevildevice.cpp:203
#7  0x0804a640 in AudioHelper::AudioHelper (this=0x9c7aa10, address=...) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/audiohelper.cpp:41
#8  0x0804a2df in main (argc=2, argv=0xbfd90bd4) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/main.cpp:49
Comment 12 Junji Shimagaki 2013-12-01 23:09:23 UTC
Created attachment 83870 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.2 using Qt 4.8.5

- What I was doing when the application crashed:

My bluetooth device is somehow recognizable (Bose Sound Link Mobile Speaker)

Now Click Bluetooth --> "Bose Sound Link .." --> Connect

And crashed

-- Backtrace (Reduced):
#6  0xb72b4a24 in BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil/bluedevil/bluedevildevice.cpp:203
#7  0x0804a640 in AudioHelper::AudioHelper (this=0x9c7aa10, address=...) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/audiohelper.cpp:41
#8  0x0804a2df in main (argc=2, argv=0xbfd90bd4) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/main.cpp:49
Comment 13 mps 2013-12-03 14:02:38 UTC
Created attachment 83900 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.95 using Qt 4.8.5

- What I was doing when the application crashed:

Same here on Fedora 20, completely up to date.

-- Backtrace (Reduced):
#5  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil-2.0/bluedevil/bluedevildevice.cpp:203
#6  0x0000000000402e0e in AudioHelper::AudioHelper (this=0x1b8fcd0, address=...) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/audiohelper.cpp:41
#7  0x0000000000402aa1 in main (argc=2, argv=0x7fff6e456c28) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/main.cpp:49
Comment 14 ark.sega 2013-12-05 18:02:49 UTC
Created attachment 83944 [details]
New crash information added by DrKonqi

bluedevil-audio (2.0.0) on KDE Platform 4.11.2 using Qt 4.8.5

- What I was doing when the application crashed:

I just try to connect my bluetooth headset, model nokia BH-503

-- Backtrace (Reduced):
#5  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil/bluedevil/bluedevildevice.cpp:203
#6  0x0000000000402f1e in AudioHelper::AudioHelper (this=0x168f7d0, address=...) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/audiohelper.cpp:41
#7  0x0000000000402bde in main (argc=1, argv=0x7fffdec1dbb8) at /usr/src/debug/bluedevil/src/actionplugins/audio/helper/main.cpp:49
Comment 15 Ian Smith 2013-12-06 18:22:38 UTC
For those looking for a work-around, the only solution I've found is to install a minimal Gnome desktop. The good news is that you don't need to use Gnome, just its control centre.

This is what I did for OpenSuse 13.1:

1) Install the patterns-openSUSE-gnome-basis metapackage - I guess other distributions have a similar minimal package.
2) Install gnome-bluetooth (if it's not already installed as part of the package)
3) In a terminal, type gnome-control-center bluetooth (or you can find the gnome-bluetooth-panel.desktop icon file in /usr/share/applications)
4) You should be able to pair and connect your headphones from the control panel.

Hope this helps
Comment 16 Junji Shimagaki 2013-12-06 22:45:46 UTC
Hi, Ian.

Thank you for that.

Well, I tested your solution but I gave up at Step 2, cause when I tried to install "gnome-bluetooth", YaST gave me a huge list of dependent packages for gnome including natulius, GTK or other necessary stuffs for operating Gnome system. (My laptop does not have good HD to store many things) On top of that, I could not find patterns-openSUSE-gnome-basis metapackage in YaST.

I am new to SUSE, but I like it pretty much except this BT defects!

Junji
Comment 17 Christian Gomez 2013-12-07 00:09:56 UTC
Not exactly a workaround but bluez-utils offers bluetoothctl which is a console frontend with really user friendly commands. Running the command 'bluetoothctl' opens an interactive shell where you can enter 'help' and learn the commands to set up your bluetooth devices. It's fairly intuitive so give that a try in the mean time those of you who are struggling without the GUI.
Comment 18 Ian Smith 2013-12-07 03:41:58 UTC
(In reply to comment #16)
> Well, I tested your solution but I gave up at Step 2, cause when I tried to
> install "gnome-bluetooth", YaST gave me a huge list of dependent packages
> for gnome including natulius, GTK or other necessary stuffs for operating
> Gnome system. (My laptop does not have good HD to store many things) On top
> of that, I could not find patterns-openSUSE-gnome-basis metapackage in YaST.
> 
@Juni If you don't have much storage space, Christian Gomez' solution might be better for your laptop. When you install the gnome-basis metapackage, you're installing a minimal version of the Gnome desktop.

Anyway, if you want to try it, in the Yast Software Management module, click on the "View" tab, and select "Patterns". In the left hand pane, select Gnome Base System, then in the right hand pane, find patterns-openSUSE-gnome-basis from the list.

BTW this problem occurred because OpenSuse updated Bluez to version 5. According to the OpenSuse 13.1 release notes, the update was necessary for the latest Gnome desktop, but breaks KDE bluetooth.
Comment 19 oliver.zemann 2013-12-07 06:54:02 UTC
The command line version does not work. Same like the GUI version as the GUI only uses the libs which are also used in the command line version. Really a pain that this bug is still not fixed :(
Vote for it!
Comment 20 Christian Gomez 2013-12-07 13:30:29 UTC
(In reply to comment #19)
> The command line version does not work. Same like the GUI version as the GUI
> only uses the libs which are also used in the command line version. Really a
> pain that this bug is still not fixed :(
> Vote for it!

Can you post what version of PulseAudio you are using? I was using Pulse v3 something at the time and when I switched to building the git version with bluez 5.11 the problems went way. Granted I am using Arch so it might be easier for me with AUR but it shouldn't be too difficult for you to compile and install the git version of PulseAudio.

My setup:
Bluez 5.11 (including bluez-lib and utils)
PulseAudio 4.0-270-g9490a (I haven't updated it in a while)
Comment 21 Ian Smith 2013-12-07 16:49:27 UTC
@(In reply to comment #19)
> The command line version does not work. Same like the GUI version as the GUI
> only uses the libs which are also used in the command line version. 

That's strange - it works for me. My understanding is that the seg fault is coming from Bluedevil, not Bluez. 

I still get a seg fault if I try to connect using Bluedevil, but everything is fine if I use either bluetoothctrl or gnome-control-center bluetooth.
Comment 22 Junji Shimagaki 2013-12-07 21:54:21 UTC
Hi, Ian and Christian.

Now it worked out! Thank you so much. My procedure was

# Open Terminal
# Type 'bluetothctl' (As Christian guided us)
# Type 'help' to see what kind of subcommands I have
# Type 'list' and confirmed my audio device
# Type 'pair <TAB>' but it is already paired
# Type 'trust <TAB>' even though I don't know what that means, but it sounds like I need it? Anyway it succeeded.
# Type 'connect <TAB>', succeeded!
# After setting more things in Audio/Video things, music came out from my BT speaker:-)

If anybody wants, I can check my bluez/bluedevil/etc. version but i could not figure out how i can get the version.

Thank you again!

Junji
Comment 23 Alex Fiestas 2013-12-19 16:04:18 UTC
This file will be removed from BlueDevil2.

Sorry for all this crashes but this is Distribution fault for shipping software that is not ready, go blame the distros for screwing your bluetooth.
Comment 24 Christian Gomez 2013-12-19 16:55:36 UTC
(In reply to comment #23)
> This file will be removed from BlueDevil2.
> 
> Sorry for all this crashes but this is Distribution fault for shipping
> software that is not ready, go blame the distros for screwing your bluetooth.

Actually Alex, I reported this bug because it IS a bug, regardless of whether or not it breaks my system is irrelevant because this is still not acceptable behavior. I understand this is not a release product but I also built this from source as you can see in the original post. This wasn't a "BLUEDEVIL BROKE MY SYSTEM! FIX IT!" but a bug report to help my fellow developers out.

Unless this bug is actually resolved and no longer happens, please refrain from closing unresolved bugs.

Thanks,
Christian
Comment 25 Alex Fiestas 2013-12-19 23:06:20 UTC
Sorry Christian, but it is up to me to decide which bugs I want to triage and what bugs I do not want to deal with, and the bluez5 branch of bluedevil is NOT ready for consumption.

If people starts reporting bugs of a branch that is massively broken it will take me a huge amount of time to triage all of them (I already wasted close to 1h today), and the time I spend doing pointless bug triaging is time I can't spend making bluez5 ready production.

Plus, doing bug triaging drains energy like crazy, I just can't deal with this.

So please, update your Bluedevil regularly and do not report bugs to bugzilla until bluez5 branch is merge to master (which will mean it is ready for production).

Finally sorry for the inconvenience, but really this is not my fault.
(In reply to comment #24)
> (In reply to comment #23)
> > This file will be removed from BlueDevil2.
> > 
> > Sorry for all this crashes but this is Distribution fault for shipping
> > software that is not ready, go blame the distros for screwing your bluetooth.
> 
> Actually Alex, I reported this bug because it IS a bug, regardless of
> whether or not it breaks my system is irrelevant because this is still not
> acceptable behavior. I understand this is not a release product but I also
> built this from source as you can see in the original post. This wasn't a
> "BLUEDEVIL BROKE MY SYSTEM! FIX IT!" but a bug report to help my fellow
> developers out.
> 
> Unless this bug is actually resolved and no longer happens, please refrain
> from closing unresolved bugs.
> 
> Thanks,
> Christian
Comment 26 Kevin Kofler 2013-12-19 23:39:09 UTC
Uh, when our (Fedora's) Bluetooth maintainers asked you about BlueZ 5 support, you claimed that it'd be ready by the time Fedora 20 releases. Now, Fedora 20 has actually slipped by a few days, so it's even later than when we originally planned to release. Now that Fedora 20 has been released, it is way too late to downgrade the whole BlueZ stack (which affects all desktops, not just KDE). Such decisions have to be made well in advance of the release, and the story you told us back then was very different from what you're saying now.
Comment 27 oliver.zemann 2013-12-20 06:50:28 UTC
Great, so this means the whole f20 is "bluetooth-broken" ? m(
Comment 28 norguhtar 2013-12-20 09:03:48 UTC
Yes in fedora 20 bluedevil broken.
Comment 29 Kevin Kofler 2013-12-20 15:37:51 UTC
Well, the gnome-bluetooth code is SUPPOSEDLY ready. Whether and to what extent that is true, I have no idea, I don't care about GNOME. ;-)
Comment 30 Rex Dieter 2013-12-20 15:56:38 UTC
Please try/test some newer f20 bluedevil builds:
https://admin.fedoraproject.org/updates/bluedevil

(the latest snapshot queue'd for updates-testing fixes all crashes for me, but I only have a mouse and phone to test with currently)
Comment 31 Jozef Mlich 2013-12-20 16:00:43 UTC
Thanks Rex. Unfortunately, I cannot test it right now. I will let you know in January.  Merry Christmas.
Comment 32 Christian Gomez 2013-12-20 17:06:21 UTC
(In reply to comment #30)
> Please try/test some newer f20 bluedevil builds:
> https://admin.fedoraproject.org/updates/bluedevil
> 
> (the latest snapshot queue'd for updates-testing fixes all crashes for me,
> but I only have a mouse and phone to test with currently)

Unfortunately my bluetooth headphones are out for repairs right now but I can throw f20 in a VM  or a separate HDD when I get them back and let you know how it goes.
Comment 33 Rákosi Gergely 2013-12-20 18:20:47 UTC
hi,

I tried the latest update, and its working perfectly. Nice work, thank you.

Rgeri77
Comment 34 Kevin Kofler 2013-12-20 22:52:35 UTC
So it looks like this is actually fixed, too, closing again.
Comment 35 Manfred Kitzbichler 2013-12-21 11:50:51 UTC
Thanks for fixing this. I saw that the package has already been updated on openSuse build service under https://build.opensuse.org/package/show/KDE:Extra/bluedevil and I installed it right away. I can confirm that the crashes are gone and that connecting to an external audio device via bluetooth works now! However, my plasma applet seems to be inconsistent in acknowledging this connection. The icon in the panel shows an existing connection, but when I click on it to disconnect, the menu shows only the "connect" option rather than disconnect.
Comment 36 GJ 2014-01-01 03:59:41 UTC
It's not fixed.  I've just installed fedora 20 with the latest build of bluedevil (2.0.0-0.11.rc1.fc20) and the same seg fault occurs trying to connect a bluetooth headset.

I'm going to go back to Fedora 18 where it works, unless anyone has a further suggestion.
Comment 37 Kevin Kofler 2014-01-01 06:10:57 UTC
You can't possibly be hitting this same bug with 2.0.0 RC1, the code which was crashing is not there anymore!

Please make sure you restarted your session after upgrading BlueDevil, and if it still crashes, please file a new bug with the new backtrace.
Comment 38 Jozef Mlich 2014-01-02 08:40:16 UTC
It seems to be fixed. At least it works for me. Thanks guys.
Comment 39 Kevin Kofler 2014-01-02 17:47:40 UTC
Oh, and @gregor:
> I'm going to go back to Fedora 18 where it works, unless anyone has a further suggestion.
Fedora 18 is going out of support in less than 2 weeks (!), so if you really can't get Fedora 20 to work, you'd better use Fedora 19, which also has the old BlueZ 4. (But as I said, you definitely shouldn't be hitting THIS bug anymore with an updated Fedora 20; if it still crashes, something else is wrong.)