[pulseaudio-tickets] [Bug 61328] PulseAudio Python Binding PyEval_CallFunction segfault in pa_mainloop_dispatch based on pa_threaded_mainloop

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Feb 23 02:06:22 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=61328

--- Comment #4 from Tanu Kaskinen <tanuk at iki.fi> ---
(In reply to comment #3)
> Thank Tanu`s reply :)
> 
> Yes pa_threaded_mainloop is working correctly in my cgtk.c and console.py
> testcases
> https://github.com/xiangzhai/pypulseaudio/blob/master/examples/cgtk.c
> 
> But the pygtk.py testcase is different from console.py, because there is
> already a GMainLoop in PyGtk (Gtk+-2.0 Python Binding), so is it possible
> that shared data from concurrent modifications by pa_threaded_mainloop &&
> GMainLoop?

No, I'm pretty sure pa_threaded_mainloop and GMainloop do not access or modify
any shared data.

The problem might be that PyEval_CallFunction() is called from the thread
created by pa_threaded_mainloop. The GMainLoop runs in a different thread, so
if PyEval_CallFunction() expects to be run in the GMainLoop thread, things will
explode.

Are you sure pa_threaded_mainloop is the right choice? If you're using
GMainLoop, you can use pa_glib_mainloop to integrate libpulse with the same
GMainLoop that you're already using. If you specifically want to run the
pulseaudio stuff in a separate thread, pa_threaded_mainloop can be used, but
then you must not call PyEval_CallFunction() directly from the libpulse
callbacks, but instead notify the GMainLoop thread about the events and call
PyEval_CallFunction() from the GMainLoop thread.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20130223/c9dc13b1/attachment-0001.html>


More information about the pulseaudio-bugs mailing list