Bug 536786 - blueman-applet-1.21-1.fc{11|12} segfaults on startup
Summary: blueman-applet-1.21-1.fc{11|12} segfaults on startup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: blueman
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Juan Manuel Rodriguez
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a75852aa11efb9034bcb0f0d61e...
: 537080 542995 576116 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-11 11:37 UTC by Bradley
Modified: 2010-03-23 16:07 UTC (History)
8 users (show)

Fixed In Version: 1.21-2.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-20 05:37:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (17.58 KB, text/plain)
2009-11-11 11:37 UTC, Bradley
no flags Details
applet log (4.05 KB, text/plain)
2009-11-12 08:15 UTC, Bradley
no flags Details
Better log (4.88 KB, text/plain)
2009-11-12 12:28 UTC, Bradley
no flags Details
Backtrace from blueman-applet from blueman-1.21-1.fc11.i586 triggered by restarting pulseaudio (via killall pulseaudio) (7.23 KB, text/plain)
2009-11-12 14:49 UTC, Dave Malcolm
no flags Details

Description Bradley 2009-11-11 11:37:44 UTC
abrt detected a crash.

Comment: Crashes on startup
Attached file: backtrace
cmdline: /usr/bin/python /usr/bin/blueman-applet
component: python
executable: /usr/bin/python
kernel: 2.6.31.5-127.fc12.x86_64
package: python-2.6.2-2.fc12
rating: 4
reason: Process was terminated by signal 11

Comment 1 Bradley 2009-11-11 11:37:48 UTC
Created attachment 369008 [details]
File: backtrace

Comment 2 Bradley 2009-11-11 11:45:19 UTC
This is from starting blueman-applet from blueman-1.21-1.fc12.x86_64 (currently in updates-testing)

Comment 3 Dave Malcolm 2009-11-12 00:24:04 UTC
Thanks for filing this bug report.

How reproducable is this problem?

I've been trying to reproduce this behavior, but haven't managed to see it yet.

If you run it from a terminal, is there any output?

Notes to self: looking at the backtrace, frames 26 and below show a pygtk application starting up.
An event comes in frame 24/25, and is dispatched into pulsecore (frames 23->18; pstream_packet_callback, pa_context_simple_ack_callback) which calls a Python callback (down to frame 15), which invokes python code down to frame 3, where it calls back into native code; whereupon the segfault happens, calling Py_DecRef on some object pointer.

Comment 4 Bradley 2009-11-12 08:09:28 UTC
So yesterday it was crashing all the time, now it happens on login (I haven't tried to see if its on each login or only the first for the reboot)

It happens all the time, even with my hardware kill switch on, and on my laptop that removes the BlueTooth adapter from the USB bus entirely, so this should in theory be reproducable for anyone. I don't have another PC to test with, though.

Now it starts on the second run. there's nothing useful in .xsession-errors for the first crash - is there some way of capturing the full console logs that appears if I run it manually from an xterm?

I have another crash that I can upload if you want, but I assume its the same. After manually starting blueman-applet, this is being sent through the new blueman with BT tethering to my iPhone, so it definitely works now(*)

(*) I had to manually run dhclient because NM doesn't recognise the bnap device, but thats a separate bug

Comment 5 Bradley 2009-11-12 08:15:57 UTC
Created attachment 369153 [details]
applet log

OK, I can reproduce this 100%. Based on the pulseaudio bits in the log, I tried:

1. killall pulseaudio
2. blueman-applet
3. Crash

Second time it works, because pulseaudio is started. It looks like the applet starts up pulseaudio but then tries to use it before its ready, and crashes?

Log attached, but its truncated (presumably python's buffering when redirecting the a file loses the output when it segfaults). I'll play arround and try to get something better when I'm not using bluetooth for my internet connection :)

Comment 6 Bradley 2009-11-12 12:24:59 UTC
*** Bug 537080 has been marked as a duplicate of this bug. ***

Comment 7 Bradley 2009-11-12 12:28:50 UTC
Created attachment 369206 [details]
Better log

This was run with the hardware kill switch enabled (ie no BT USB adapter) after doing |killall pulseaudio|

Comment 8 Dave Malcolm 2009-11-12 14:02:20 UTC
Thanks for the info.

Looks like a bug in the blueman candidate update package, or, at least, a bad interaction between various components.

I see this is for https://admin.fedoraproject.org/updates/F12/FEDORA-2009-11145 and that you've already reported this there (thanks!)

I just now managed to reproduce this on an i386 F11 box with the F11 version of that update (https://admin.fedoraproject.org/updates/F11/FEDORA-2009-11065 ); I've commented there accordingly.

Comment 9 Dave Malcolm 2009-11-12 14:40:58 UTC
Segfault seems to be happening in /usr/lib/python2.6/site-packages/blueman/main/PulseAudioUtils.py

within the:
			pythonapi.Py_DecRef(data)
call here:
	def simple_callback(self, handler, function, *args):
				
		def wrapper(context, res, data):
			if handler:
				handler(res)
			pythonapi.Py_DecRef(data)
			
		cb = pa_context_index_cb_t(wrapper)
		pythonapi.Py_IncRef(py_object(cb))
		
		args += (cb, py_object(cb))
		
		self.pa.pa_operation_unref(function(self.pa_context, *args))

Comment 10 Dave Malcolm 2009-11-12 14:41:38 UTC
(indentation of above mangled by bugzilla, alas)

Comment 11 Dave Malcolm 2009-11-12 14:49:42 UTC
Created attachment 369224 [details]
Backtrace from blueman-applet from blueman-1.21-1.fc11.i586 triggered by restarting pulseaudio (via killall pulseaudio)

Comment 12 Dave Malcolm 2009-11-12 15:01:35 UTC
If I change line 173 of /usr/lib/python2.6/site-packages/blueman/main/PulseAudioUtils.py
from
     pythonapi.Py_DecRef(data)
to
     pythonapi.Py_DecRef(py_object(data))
then the segfault seems to go away.  Not yet sure if it's the correct fix.

Comment 13 Dave Malcolm 2009-11-12 19:06:27 UTC
Adding the additional py_object() wrapper looks like a reasonable way to fix up that code - the ctypes function call is expecting a PyObject* that's a _ctypes.SimpleType, storing a reference to the underlying PyObject*, rather than simply the original PyObject*.

Having said that, does libpulse have python bindings?  Doing it all through ctypes is fragile and is likely to break (e.g. if anything changes in the libpulse API, you're going to have to manually update it there, and in every other such user of the API, rather than fixing it in one place).

Comment 14 Dave Malcolm 2009-11-12 19:07:27 UTC
(I don't have a launchpad account, so I can't send this upstream)

Comment 15 Juan Manuel Rodriguez 2009-11-12 19:09:27 UTC
I talked to walmis, the Blueman developer. Blueman 1.21-2 should arrive shortly in the testing repos.

Comment 16 Juan Manuel Rodriguez 2009-11-12 19:10:02 UTC
Forgot to add, he's using
 pythonapi.Py_DecRef(py_object(data))

To fix the issue, as you suggested, Dave.

Comment 17 Fedora Update System 2009-11-12 19:23:27 UTC
blueman-1.21-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/blueman-1.21-2.fc11

Comment 18 Fedora Update System 2009-11-12 19:53:20 UTC
blueman-1.21-2.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/blueman-1.21-2.fc12

Comment 19 Bradley 2009-11-12 20:55:00 UTC
Fixes the crash - thanks a lot for the quick response. Unfortunately the update breaks connecting to the iPhone entirely, but thats a separate bug...

Comment 20 Dave Malcolm 2009-11-14 13:00:14 UTC
(In reply to comment #19)
> Fixes the crash - thanks a lot for the quick response. Unfortunately the update
> breaks connecting to the iPhone entirely, but thats a separate bug...  
(for posterity: the iPhone connectivity regression was bug 537089)

Comment 21 Fedora Update System 2009-11-16 07:28:48 UTC
blueman-1.21-2.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update blueman'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11519

Comment 22 Fedora Update System 2009-11-16 07:34:46 UTC
blueman-1.21-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update blueman'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-11594

Comment 23 Fedora Update System 2009-11-20 05:37:13 UTC
blueman-1.21-2.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Dave Malcolm 2009-12-01 16:01:01 UTC
*** Bug 542995 has been marked as a duplicate of this bug. ***

Comment 25 Fedora Update System 2009-12-22 19:55:07 UTC
blueman-1.21-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Dave Malcolm 2010-03-23 16:07:23 UTC
*** Bug 576116 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.