Bug 326871 - Segfault in BlueDevil::Device::isPaired()
Summary: Segfault in BlueDevil::Device::isPaired()
Status: RESOLVED NOT A BUG
Alias: None
Product: solid
Classification: Unmaintained
Component: bluetooth (show other bugs)
Version: 4.11.60
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
: 328992 329197 332023 332095 334203 336756 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-30 10:31 UTC by Michi
Modified: 2014-06-27 09:11 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (4.65 KB, text/plain)
2014-03-03 13:22 UTC, Bruce
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michi 2013-10-30 10:31:59 UTC
I use the latest libbluedevil and bluedevil from branch bluez5 and get the following crash when I try to open a PAN or DUN resopectively.

Application: Bluetooth Network PANU Helper (bluedevil-network-panu), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#5  0x00007fd59164d5fd in BlueDevil::Device::isPaired() const () from /usr/lib64/libbluedevil.so.2
#6  0x0000000000402f1e in NetworkPANUHelper::NetworkPANUHelper(KUrl const&) ()
#7  0x0000000000402bde in main ()

Reproducible: Always
Comment 1 Wiktor 2013-11-26 13:40:27 UTC
Not sure if related, but yesterday there was update in Arch Linux introducing Bluedevil 2.0. Now it's unusable, because when trying to connect do device I get crash report

Application: Bluetooth Audio Helper (bluedevil-audio), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[KCrash Handler]
#5  0x00007ff50ae96fed in BlueDevil::Device::isPaired() const () from /usr/lib/libbluedevil.so.2
#6  0x0000000000402d2e in _start ()

Sorry for useless informations, but I there is no debug packages in Arch repo…
Comment 2 Daniel Albers 2013-11-29 11:08:06 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 norguhtar 2013-12-18 07:34:21 UTC
In fedora 20 too:

Application: Инструмент для настройки аудиослужбы Bluetooth (bluedevil-audio), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#5  0x00007fcd0e1c65bd in BlueDevil::Device::isPaired() const () from /lib64/libbluedevil.so.2
#6  0x0000000000402e0e in AudioHelper::AudioHelper(KUrl const&) ()
#7  0x0000000000402aa1 in main ()
Comment 4 norguhtar 2013-12-18 07:56:53 UTC
Crush dump with debug symbols:
Application: Инструмент для настройки аудиослужбы Bluetooth (bluedevil-audio), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
81	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil-2.0/bluedevil/bluedevildevice.cpp:203
#7  0x0000000000402e0e in AudioHelper::AudioHelper (this=0x18916c0, address=...) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/audiohelper.cpp:41
#8  0x0000000000402aa1 in main (argc=2, argv=0x7fff6fcaa958) at /usr/src/debug/bluedevil-2.0.0/src/actionplugins/audio/helper/main.cpp:49
Comment 5 Manfred Kitzbichler 2013-12-18 09:53:04 UTC
The crash could be fixed rather easily. It's just caused by the 0x0 pointer to device, that's why the isPaired method fails. Obviously this shouldn't happen, at least the failed call should be caught. But none of this is the real problem here, because even with a valid pointer to device, the bluetooth connection fails (silently). Presumably because of some other incompatibility with the new bluez5 libraries.

I am just reposting here what I have already written for bug 325364, which is probably the same issue:
------------------------------
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 6 oliver.zemann 2013-12-18 11:16:02 UTC
Please vote - maybe someone will fix this if the vote is high enough
Comment 7 Jekyll Wu 2013-12-19 06:44:21 UTC
*** Bug 328992 has been marked as a duplicate of this bug. ***
Comment 8 Alex Fiestas 2013-12-19 16:03:09 UTC
This won't be fixed, the files are to be removed from bluedevil 2.

Please, if you use OpenSuse with a snapshot of BlueDevil 2.0, or BlueZ minor to 5.11 do not bother reporting the bugs, most of them will be invalid.
Comment 9 Jekyll Wu 2013-12-24 15:26:34 UTC
*** Bug 329197 has been marked as a duplicate of this bug. ***
Comment 10 Bruce 2014-03-03 13:22:28 UTC
Created attachment 85399 [details]
New crash information added by DrKonqi

bluedevil-wizard (2.0.0) on KDE Platform 4.12.2 using Qt 4.8.5

- What I was doing when the application crashed:
I was paring a Jawbone Jambox to Fedora 20 running KDE on a Lenovo t430s.

-- Backtrace (Reduced):
#6  BlueDevil::Device::isPaired (this=this@entry=0x0) at /usr/src/debug/libbluedevil-2.0-rc1/bluedevil/bluedevildevice.cpp:203
#7  0x000000000040d06c in DiscoverPage::nextId (this=this@entry=0x1d43d40) at /usr/src/debug/bluedevil-2.0-rc1/src/wizard/pages/discoverpage.cpp:201
#8  0x000000000040d776 in DiscoverPage::nextId (this=0x1d43d40) at /usr/src/debug/bluedevil-2.0-rc1/src/wizard/pages/discoverpage.cpp:185
#9  0x000000349eed328c in QWizard::next (this=0x1cf1a10) at dialogs/qwizard.cpp:3115
[...]
#11 0x000000349f04b0f2 in QAbstractButton::clicked (this=this@entry=0x1d21ac0, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:219
Comment 11 Jekyll Wu 2014-03-11 13:59:23 UTC
*** Bug 332023 has been marked as a duplicate of this bug. ***
Comment 12 Jekyll Wu 2014-03-13 14:03:41 UTC
*** Bug 332095 has been marked as a duplicate of this bug. ***
Comment 13 Bruce 2014-03-13 16:38:24 UTC
What does RESOLVED INVALID mean?  This bug is NOT resolved in Fedora 20 at this time.

Bruce
Comment 14 857abb88 2014-03-16 08:27:17 UTC
Hey Bruce,

I was having this very same issue on my openSuSE 13.1 install. Per Alex Fiestas suggestion, I tried upgrading both bluedevil and bluez. Both actually went smoothly (it added the KDE:Extra repo, which also upgraded libbluedevil plus a few extra packages with a vendor change). Once I upgraded to bluez 5.15 (http://software.opensuse.org/package/bluez) and bluedevil 2.0~rc1 (http://software.opensuse.org/package/bluedevil), bluetooth works flawlessly. I'll bet you might be able to manually upgrade the packages in a similar fashion on Fedora 20 to these versions and see similar results as I.

Just my 2 cents of course...and confirming that upgrading bluez to 5.15, and bluedevil and libbluedevil to 2.0~rc1 has resolved my issue.
Comment 15 857abb88 2014-03-16 08:31:27 UTC
To clarify:

Resolved my issue on openSuSE 13.1 x86-64 running KDE 4.11.5 and kernel 3.11.10-7-desktop.

Let me know if further clarification is necessary and/or could be useful.
Comment 16 Manfred Kitzbichler 2014-03-16 13:06:09 UTC
I am afraid I have to agree with the previous poster, the problem has not been entirely fixed, even with the newest bluez and bluedevil packages from the OBS. See my post here: https://bugs.kde.org/show_bug.cgi?id=325364#c35
The connection with a device seems to be working now without segfault, but it's not possible anymore to disconnect because the applet doesn't recognize the connection. 
Secondly, and this might be entirely unrelated, after some time (a few days) the device I was previously connecting to suddenly disappears without a trace from the list of available bluetooth devices and I have to reboot to be able to find it again.



(In reply to comment #15)
> To clarify:
> 
> Resolved my issue on openSuSE 13.1 x86-64 running KDE 4.11.5 and kernel
> 3.11.10-7-desktop.
> 
> Let me know if further clarification is necessary and/or could be useful.
Comment 17 Alex Fiestas 2014-03-16 15:11:52 UTC
Please report those as a different bugs, this one is only about the crash itself.
(In reply to comment #16)
> I am afraid I have to agree with the previous poster, the problem has not
> been entirely fixed, even with the newest bluez and bluedevil packages from
> the OBS. See my post here: https://bugs.kde.org/show_bug.cgi?id=325364#c35
> The connection with a device seems to be working now without segfault, but
> it's not possible anymore to disconnect because the applet doesn't recognize
> the connection. 
> Secondly, and this might be entirely unrelated, after some time (a few days)
> the device I was previously connecting to suddenly disappears without a
> trace from the list of available bluetooth devices and I have to reboot to
> be able to find it again.
> 
> 
> 
> (In reply to comment #15)
> > To clarify:
> > 
> > Resolved my issue on openSuSE 13.1 x86-64 running KDE 4.11.5 and kernel
> > 3.11.10-7-desktop.
> > 
> > Let me know if further clarification is necessary and/or could be useful.
Comment 18 Alex Fiestas 2014-03-16 15:13:09 UTC
Btw this bug is fixed in what will be rc2, so you need a snapshot of the recent code to get this fixed.
Comment 19 Jekyll Wu 2014-05-03 00:47:41 UTC
*** Bug 334203 has been marked as a duplicate of this bug. ***
Comment 20 Jekyll Wu 2014-06-27 00:49:21 UTC
*** Bug 336756 has been marked as a duplicate of this bug. ***