Pybluez segfaults if bluez not running

Bug #126068 reported by Eric Butler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bluez-libs (Ubuntu)
Fix Released
Undecided
Daniel Holbach

Bug Description

If bluez is not running (/etc/init.d/bluetooth stop), pybluez will segfault if you try to use it.

This code can be used to reproduce the problem:
http://org.csail.mit.edu/pybluez/examples-0.7/rfcomm-server.txt

Here's the backtrace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210058544 (LWP 1050)]
0xb7d1037a in sdp_device_record_register_binary () from /usr/lib/libbluetooth.so.2
(gdb) backtrace
#0 0xb7d1037a in sdp_device_record_register_binary () from /usr/lib/libbluetooth.so.2
#1 0xb7d105c3 in sdp_device_record_register () from /usr/lib/libbluetooth.so.2
#2 0xb7d106ab in sdp_record_register () from /usr/lib/libbluetooth.so.2
#3 0xb7f9a45b in bt_sdp_advertise_service () from /usr/lib/python2.5/site-packages/_bluetooth.so
#4 0x080c8b3c in PyEval_EvalFrameEx (f=0x81d0854, throwflag=0) at ../Python/ceval.c:3564
#5 0x080c9d65 in PyEval_EvalCodeEx (co=0xb7d9b578, globals=0xb7d8f824, locals=0x0, args=0x8174120, argcount=2, kws=0x8174128, kwcount=3, defs=0xb7da4968, defcount=6,
    closure=0x0) at ../Python/ceval.c:2831
#6 0x080c8229 in PyEval_EvalFrameEx (f=0x8173fe4, throwflag=0) at ../Python/ceval.c:3660
#7 0x080c9d65 in PyEval_EvalCodeEx (co=0xb7d87458, globals=0xb7dd7acc, locals=0xb7dd7acc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at ../Python/ceval.c:2831
#8 0x080c9dd7 in PyEval_EvalCode (co=0xb7d87458, globals=0xb7dd7acc, locals=0xb7dd7acc) at ../Python/ceval.c:494
#9 0x080e91d8 in PyRun_FileExFlags (fp=0x816a008, filename=0xbfe7e983 "rfcomm-server.py", start=257, globals=0xb7dd7acc, locals=0xb7dd7acc, closeit=1, flags=0xbfe7cde8)
    at ../Python/pythonrun.c:1271
#10 0x080e9467 in PyRun_SimpleFileExFlags (fp=0x816a008, filename=0xbfe7e983 "rfcomm-server.py", closeit=1, flags=0xbfe7cde8) at ../Python/pythonrun.c:877
#11 0x08059330 in Py_Main (argc=1, argv=0xbfe7ceb4) at ../Modules/main.c:523
#12 0x08058862 in main (argc=615989, argv=0x1c143501) at ../Modules/python.c:23

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Thank you for your bug report.
Attached debdiff should fix this issue.

Changed in bluez-libs:
status: New → Confirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

Looks good. Testing it.

Marcel: can this go upstream?

Changed in bluez-libs:
assignee: nobody → dholbach
status: Confirmed → In Progress
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

bluez-libs (3.18-0ubuntu2) gutsy; urgency=low

  * Fix SIGSEGV error if no session is found (LP: #126068)

 -- Luca Falavigna <email address hidden> Sat, 08 Sep 2007 21:00:48 +0200

Changed in bluez-libs:
status: In Progress → Fix Released
Revision history for this message
Kamalesh Narayan Nair (kamaleshnair) wrote :

Hi Experts,

I am facing the same issue on an Ubuntu 16.04 LTS although with a C++ program but with the same function call - sdp_record_register() that causes a Segmentation fault. Could you please tell me how this can be fixed?

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.