[pulseaudio-tickets] [Bug 61328] New: 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
Fri Feb 22 22:24:40 PST 2013
https://bugs.freedesktop.org/show_bug.cgi?id=61328
Priority: medium
Bug ID: 61328
CC: lennart at poettering.net
Assignee: pulseaudio-bugs at lists.freedesktop.org
Summary: PulseAudio Python Binding PyEval_CallFunction segfault
in pa_mainloop_dispatch based on pa_threaded_mainloop
QA Contact: pulseaudio-bugs at lists.freedesktop.org
Severity: normal
Classification: Unclassified
OS: Linux (All)
Reporter: xiangzhai83 at gmail.com
Hardware: x86-64 (AMD64)
Status: NEW
Version: unspecified
Component: clients
Product: PulseAudio
Hi PulseAudio developers,
I am developing PulseAudio Python Binding in C based on pa_threaded_mainloop to
handle pa_context_subscribe callback.
For example, when received PA_SUBSCRIPTION_EVENT_SINK
PA_SUBSCRIPTION_EVENT_CHANGE event, I used PyEval_CallFunction to call Python
(pygtk.py) callback.
Then pygtk.py testcase throw segfault, gdb DEBUG shown as below:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffebb3f700 (LWP 10150)]
0x00000000004e9f20 in PyObject_Call ()
(gdb) bt
#0 0x00000000004e9f20 in PyObject_Call ()
#1 0x00000000004ea396 in PyEval_CallObjectWithKeywords ()
#2 0x0000000000478a99 in PyEval_CallFunction ()
#3 0x00007fffed1969b6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4 0x00007fffecd45693 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#5 0x00007fffecd45a03 in pa_pdispatch_run () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#6 0x00007fffed18cbdd in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#7 0x00007fffecd4a2a9 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#8 0x00007fffed19fa1e in pa_mainloop_dispatch () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#9 0x00007fffed19fde5 in pa_mainloop_iterate () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#10 0x00007fffed19fe90 in pa_mainloop_run () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#11 0x00007fffed1ae30f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#12 0x00007fffecd57d18 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#13 0x00007ffff7bc4e9a in start_thread (arg=0x7fffebb3f700) at
pthread_create.c:308
#14 0x00007ffff69b3cbd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#15 0x0000000000000000 in ?? ()
I tried to add PyGILState_Ensure() & PyGILState_Release() around
PyEval_CallFunction() for locking/unlocking, it still throw another segfault
shown as below:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffebb3f700 (LWP 10362)]
sem_post () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S:34
(gdb) bt
#0 sem_post () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S:34
#1 0x00000000004d456e in PyGILState_Release ()
#2 0x00007fffed1969b6 in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#3 0x00007fffecd45693 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#4 0x00007fffecd45a03 in pa_pdispatch_run () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#5 0x00007fffed18cbdd in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6 0x00007fffecd4a2a9 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#7 0x00007fffed19fa1e in pa_mainloop_dispatch () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#8 0x00007fffed19fde5 in pa_mainloop_iterate () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#9 0x00007fffed19fe90 in pa_mainloop_run () from
/usr/lib/x86_64-linux-gnu/libpulse.so.0
#10 0x00007fffed1ae30f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#11 0x00007fffecd57d18 in ?? () from
/usr/lib/x86_64-linux-gnu/libpulsecommon-1.1.so
#12 0x00007ffff7bc4e9a in start_thread (arg=0x7fffebb3f700) at
pthread_create.c:308
#13 0x00007ffff69b3cbd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#14 0x0000000000000000 in ?? ()
However, the console.py (non-gtk & no g_main_loop) testcase worked happily
without segfault, and I added cgtk.c (Gtk+-2.0 based testcase in C) worked
correctly!
The source code and testcase host on github
https://github.com/xiangzhai/pypulseaudio please someone give me advice, thanks
a lot!
--
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/c05703de/attachment.html>
More information about the pulseaudio-bugs
mailing list