[pulseaudio-tickets] [PulseAudio] #703: Deadlock in libpulse when frequently stopping/starting audio
PulseAudio
trac-noreply at tango.0pointer.de
Mon Nov 2 08:34:09 PST 2009
#703: Deadlock in libpulse when frequently stopping/starting audio
----------------------+-----------------------------------------------------
Reporter: aldimond | Owner: lennart
Type: defect | Status: new
Milestone: | Component: libpulse
Keywords: |
----------------------+-----------------------------------------------------
The program I'm using is Audacity (which goes through PortAudio -- the
deadlock does not occur unless i output through Pulse). I can easily
repro this by playing anything, then dragging around the "Play at Speed"
slider. The Pulse server continues to work fine. I'm using Pulse
v0.9.19. Another developer is using 0.9.14 and doesn't have this problem.
Here's a backtrace:
{{{
(gdb) thread apply all bt full
Thread 431 (Thread 0x7fffe15b1910 (LWP 12847)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
No locals.
#1 0x00007fffe6e4442b in pa_threaded_mainloop_wait (m=0x2065350) at pulse
/thread-mainloop.c:209
__func__ = "pa_threaded_mainloop_wait"
__PRETTY_FUNCTION__ = "pa_threaded_mainloop_wait"
#2 0x00007fffe65b92aa in pulse_wait_operation () from /usr/lib/alsa-
lib/libasound_module_pcm_pulse.so
No symbol table info available.
#3 0x00007fffe65b8774 in ?? () from /usr/lib/alsa-
lib/libasound_module_pcm_pulse.so
No symbol table info available.
#4 0x00007ffff3f69867 in ?? () from /usr/lib/libasound.so.2
No symbol table info available.
#5 0x0000000000955c19 in AlsaStop (stream=0x24a6b40, abort=128) at
src/hostapi/alsa/pa_linux_alsa.c:2196
result = <value optimized out>
#6 0x0000000000956bfa in OnExit (data=0x24a6b40) at
src/hostapi/alsa/pa_linux_alsa.c:2513
__PRETTY_FUNCTION__ = "OnExit"
#7 0x000000000095b5a8 in CallbackThreadFunc (userData=<value optimized
out>) at src/hostapi/alsa/pa_linux_alsa.c:3251
__cancel_buf = {__cancel_jmp_buf = {{__cancel_jmp_buf =
{140736974231824, 8249672085128685470, 140737488343584, 0, 0, 3,
-8249614046678145122, 8249671094559909790}, __mask_was_saved = 0}},
__pad = {0x7fffe15b10a0, 0x0, 0x7ffff3abd9aa, 0x0}}
not_first_call = -512
result = <value optimized out>
stream = 0x24a6b40
timeInfo = {inputBufferAdcTime = 0.046439909297052155, currentTime
= 0, outputBufferDacTime = 0.046439909297052155}
callbackResult = 0
cbFlags = <value optimized out>
__PRETTY_FUNCTION__ = "CallbackThreadFunc"
#8 0x00007ffff3abca04 in start_thread (arg=<value optimized out>) at
pthread_create.c:300
__res = <value optimized out>
pd = 0x7fffe15b1910
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736974231824,
8249672085128685470, 140737488343584, 0, 0, 3, -8249614046577481826,
-8249646351502465122}, mask_was_saved = 0}}, priv = {
pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0,
canceltype = 0}}}
not_first_call = <value optimized out>
robust = <value optimized out>
#9 0x00007ffff307b7bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#10 0x0000000000000000 in ?? ()
No symbol table info available.
Thread 430 (Thread 0x7fffe1db2910 (LWP 12846)):
#0 __pthread_mutex_lock_full (mutex=0x26393d0) at
pthread_mutex_lock.c:303
private = <value optimized out>
e = <value optimized out>
kind = 1
robust = 0
oldval = <value optimized out>
__PRETTY_FUNCTION__ = "__pthread_mutex_lock_full"
#1 0x00007fffe6c044ee in pa_mutex_lock (m=0x26393d0) at pulsecore/mutex-
posix.c:90
__func__ = "pa_mutex_lock"
__PRETTY_FUNCTION__ = "pa_mutex_lock"
#2 0x00007fffe6e44219 in poll_func (ufds=<value optimized out>, nfds=2,
timeout=10, userdata=0x26393d0) at pulse/thread-mainloop.c:76
r = 1
__func__ = "poll_func"
__PRETTY_FUNCTION__ = "poll_func"
#3 0x00007fffe6e345e6 in pa_mainloop_poll (m=0x21f0700) at
pulse/mainloop.c:879
__func__ = "pa_mainloop_poll"
__PRETTY_FUNCTION__ = "pa_mainloop_poll"
#4 0x00007fffe6e35eb9 in pa_mainloop_iterate (m=0x21f0700, block=<value
optimized out>, retval=0x0) at pulse/mainloop.c:961
r = <value optimized out>
__func__ = "pa_mainloop_iterate"
__PRETTY_FUNCTION__ = "pa_mainloop_iterate"
---Type <return> to continue, or q <return> to quit---
#5 0x00007fffe6e35f70 in pa_mainloop_run (m=0x21f0700, retval=0x0) at
pulse/mainloop.c:979
r = <value optimized out>
#6 0x00007fffe6e4412b in thread (userdata=0x2065350) at pulse/thread-
mainloop.c:94
mask = {__val = {18446744067267100671, 18446744073709551615
<repeats 15 times>}}
#7 0x00007fffe6c05050 in internal_thread_func (userdata=0x2042f60) at
pulsecore/thread-posix.c:72
__func__ = "internal_thread_func"
__PRETTY_FUNCTION__ = "internal_thread_func"
#8 0x00007ffff3abca04 in start_thread (arg=<value optimized out>) at
pthread_create.c:300
__res = <value optimized out>
pd = 0x7fffe1db2910
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736982624528,
8249672085128685470, 140737281552512, 0, 0, 3, -8249615145552238690,
-8249646351502465122}, mask_was_saved = 0}}, priv = {
pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0,
canceltype = 0}}}
not_first_call = <value optimized out>
robust = <value optimized out>
#9 0x00007ffff307b7bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#10 0x0000000000000000 in ?? ()
No symbol table info available.
Current language: auto
The current source language is "auto; currently asm".
Thread 6 (Thread 0x7fffe25b3910 (LWP 11987)):
#0 0x00007ffff3ac48f1 in nanosleep () from /lib/libpthread.so.0
No symbol table info available.
#1 0x00007ffff60bea8c in wxMicroSleep (microseconds=<value optimized
out>) at ../src/unix/utilsunx.cpp:191
tmReq = {tv_sec = 0, tv_nsec = 10000000}
#2 0x0000000000592e50 in AudioThread::Entry (this=0x7fffdc001650) at
AudioIO.cpp:1676
No locals.
#3 0x00007ffff60b8a3a in wxThreadInternal::PthreadStart
(thread=0x7fffdc001650) at ../src/unix/threadpsx.cpp:766
pthread = 0x7fffdc002940
rc = <value optimized out>
dontRunAtAll = false
__FUNCTION__ = "PthreadStart"
#4 0x00007ffff3abca04 in start_thread (arg=<value optimized out>) at
pthread_create.c:300
__res = <value optimized out>
pd = 0x7fffe25b3910
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736991017232,
8249672085128685470, 140737488346432, 0, 0, 3, -8249611846480484450,
-8249646351502465122}, mask_was_saved = 0}}, priv = {
pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0,
canceltype = 0}}}
not_first_call = <value optimized out>
robust = <value optimized out>
#5 0x00007ffff307b7bd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#6 0x0000000000000000 in ?? ()
No symbol table info available.
Current language: auto
The current source language is "auto; currently c".
Thread 1 (Thread 0x7ffff7fb47f0 (LWP 11980)):
#0 0x00007ffff3abdcfd in pthread_join (threadid=140736974231824,
thread_return=0x7fffffffd138) at pthread_join.c:89
__ignore = <value optimized out>
_tid = 12847
_buffer = {__routine = 0x7ffff3abdbd0 <cleanup>, __arg =
0x7fffe15b1d38, __canceltype = 0, __prev = 0x0}
oldtype = 0
result = <value optimized out>
#1 0x00000000009537e1 in PaUnixThread_Terminate (self=0x24a6cd0,
wait=<value optimized out>, exitResult=0x7fffffffd16c) at
src/os/unix/pa_unix_util.c:406
result = <value optimized out>
pret = <value optimized out>
__PRETTY_FUNCTION__ = "PaUnixThread_Terminate"
#2 0x00000000009569c3 in RealStop (stream=0x24a6b40, abort=<value
optimized out>) at src/hostapi/alsa/pa_linux_alsa.c:2256
threadRes = 0
result = <value optimized out>
#3 0x00000000005917d5 in AudioIO::StopStream (this=0x1eb1510) at
AudioIO.cpp:1189
No locals.
---Type <return> to continue, or q <return> to quit---
#4 0x000000000079cd03 in ControlToolBar::StopPlaying (this=0x20dca80) at
toolbars/ControlToolBar.cpp:709
project = 0x7fffdc09e810
#5 0x00000000007b277c in TranscriptionToolBar::OnPlaySpeed
(this=0x20ddb50, event=...) at toolbars/TranscriptionToolBar.cpp:404
p = 0x7fffdc09e810
playRegionStart = 6.9533558073029944e-310
playRegionEnd = 1.5755287047907678e-316
#6 0x00000000007b28c9 in TranscriptionToolBar::OnSpeedSlider
(this=0x20ddb50, event=...) at toolbars/TranscriptionToolBar.cpp:433
No locals.
#7 0x00007ffff60b97b0 in wxEvtHandler::ProcessEventIfMatches
(entry=<value optimized out>, handler=0x0, event=...) at
../src/common/event.cpp:1231
tableId1 = <value optimized out>
tableId2 = <value optimized out>
#8 0x00007ffff60bace7 in wxEventHashTable::HandleEvent (this=<value
optimized out>, event=..., self=0x20ddb50) at ../src/common/event.cpp:906
n = 0
count = 2
eventType = <value optimized out>
eTTnode = 0x2183ec0
#9 0x00007ffff60bae28 in wxEvtHandler::ProcessEvent (this=0x20ddb50,
event=...) at ../src/common/event.cpp:1293
__FUNCTION__ = "ProcessEvent"
#10 0x00007ffff6a857fd in wxWindowBase::TryParent (this=<value optimized
out>, event=...) at ../src/common/wincmn.cpp:2661
parent = 0x20ddb50
#11 0x00000000007bbcce in LWSlider::SendUpdate (this=0x1e696a0,
newValue=0.00999999978) at widgets/ASlider.cpp:1105
e = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x1cc2770, static
ms_classInfo = {m_className = 0x7ffff60e87d0 L"wxObject", m_objectSize =
16, m_objectConstructor = 0, m_baseInfo1 = 0x0,
m_baseInfo2 = 0x0, static sm_first = 0x0, m_next =
0x7ffff6341d00, static sm_classTable = 0x1ce5980}, m_refData = 0x0},
m_eventObject = 0x0, m_eventType = 10087, m_timeStamp = 0,
m_id = 11, m_callbackUserData = 0x0, m_propagationLevel =
2147483646, m_skipped = false, m_isCommandEvent = true, static
ms_classInfo = {m_className = 0x0, m_objectSize = 0,
m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 =
0x0, static sm_first = 0x0, m_next = 0x0, static sm_classTable =
0x1ce5980}}, m_cmdString = {<wxStringBase> = {
static npos = 18446744073709551615, m_pchData =
0x7ffff60ed818 L""}, <No data fields>}, m_commandInt = 0, m_extraLong = 0,
m_clientData = 0x0, m_clientObject = 0x0,
static ms_classInfo = {m_className = 0x7ffff6ad84a0
L"wxCommandEvent", m_objectSize = 104, m_objectConstructor =
0x7ffff6942ab0 <wxCommandEvent::wxCreateObject()>,
m_baseInfo1 = 0x1cbba60, m_baseInfo2 = 0x0, static sm_first =
0x0, m_next = 0x7ffff6ddd580, static sm_classTable = 0x1ce5980}}
intValue = 0
#12 0x00000000007bb79a in LWSlider::OnMouseEvent (this=0x1e696a0,
event=...) at widgets/ASlider.cpp:1019
prevValue = 1.40314603
r = {x = 41, y = 9, width = 11, height = 14}
tolerantThumbRect = {x = 38, y = 6, width = 17, height = 20}
#13 0x00000000007bcbf0 in ASlider::OnMouseEvent (this=0x1e69170,
event=...) at widgets/ASlider.cpp:1380
No locals.
#14 0x00007ffff60b97b0 in wxEvtHandler::ProcessEventIfMatches
(entry=<value optimized out>, handler=0x0, event=...) at
../src/common/event.cpp:1231
tableId1 = <value optimized out>
tableId2 = <value optimized out>
#15 0x00007ffff60bace7 in wxEventHashTable::HandleEvent (this=<value
optimized out>, event=..., self=0x1e69170) at ../src/common/event.cpp:906
n = 0
count = 1
eventType = <value optimized out>
eTTnode = 0x1dcd090
#16 0x00007ffff60bae28 in wxEvtHandler::ProcessEvent (this=0x1e69170,
event=...) at ../src/common/event.cpp:1293
__FUNCTION__ = "ProcessEvent"
#17 0x00007ffff6980b6a in gtk_window_motion_notify_callback (widget=<value
optimized out>, gdk_event=0x21c7a60, win=0x1e69170) at
../src/gtk/window.cpp:1786
rc = <value optimized out>
event = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x1cc3030,
static ms_classInfo = {m_className = 0x7ffff60e87d0 L"wxObject",
m_objectSize = 16, m_objectConstructor = 0,
m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first =
0x0, m_next = 0x7ffff6341d00, static sm_classTable = 0x1ce5980}, m_refData
= 0x0}, m_eventObject = 0x1e69170,
m_eventType = 10103, m_timeStamp = 85361163, m_id = 11,
m_callbackUserData = 0x0, m_propagationLevel = 0, m_skipped = false,
m_isCommandEvent = false, static ms_classInfo = {
m_className = 0x0, m_objectSize = 0, m_objectConstructor =
0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x0, m_next =
0x0, static sm_classTable = 0x1ce5980}}, m_x = 2,
m_y = 15, m_leftDown = true, m_middleDown = false, m_rightDown =
false, m_controlDown = false, m_shiftDown = false, m_altDown = false,
m_metaDown = false, m_wheelRotation = 0,
m_wheelDelta = 0, m_linesPerAction = 0, static ms_classInfo =
{m_className = 0x7ffff6ad8598 L"wxMouseEvent", m_objectSize = 96,
m_objectConstructor = 0x7ffff6942850
<wxMouseEvent::wxCreateObject()>, m_baseInfo1 = 0x1cbba60, m_baseInfo2 =
0x0, static sm_first = 0x0, m_next = 0x7ffff6ddd680,
static sm_classTable = 0x1ce5980}}
ret = false
#18 0x00007ffff2ad2728 in _gtk_marshal_BOOLEAN__BOXED (closure=0x217f380,
return_value=0x7fffffffdb80, n_param_values=<value optimized out>,
param_values=0x2668d00,
invocation_hint=<value optimized out>, marshal_data=0x7ffff6980a20) at
/build/buildd/gtk+2.0-2.18.3/gtk/gtkmarshalers.c:84
data1 = 0x2164270
data2 = 0x322f
v_return = <value optimized out>
---Type <return> to continue, or q <return> to quit---
__PRETTY_FUNCTION__ = "_gtk_marshal_BOOLEAN__BOXED"
#19 0x00007ffff24ab5ae in IA__g_closure_invoke (closure=0x217f380,
return_value=0x7fffffffdb80, n_param_values=2, param_values=0x2668d00,
invocation_hint=0x7fffffffdb40)
at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c:767
marshal = 0xfffffffffffffe00
marshal_data = 0x1b
__PRETTY_FUNCTION__ = "IA__g_closure_invoke"
#20 0x00007ffff24c0983 in signal_emit_unlocked_R (node=0x1dbee50,
detail=<value optimized out>, instance=<value optimized out>,
emission_return=<value optimized out>,
instance_and_params=<value optimized out>) at
/build/buildd/glib2.0-2.22.2/gobject/gsignal.c:3247
tmp = 0x7ffff3ac06b0
handler = 0x217f530
accumulator = 0x1dbeed0
emission = {next = 0x0, instance = 0x2164270, ihint = {signal_id =
42, detail = 0, run_type = G_SIGNAL_RUN_FIRST}, state = EMISSION_RUN,
chain_type = 4}
class_closure = 0x1dbede0
handler_list = 0x217f530
return_accu = <value optimized out>
accu = {g_type = 20, data = {{v_int = 0, v_uint = 0, v_long = 0,
v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0,
v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0,
v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0,
v_double = 0, v_pointer = 0x0}}}
signal_id = 42
max_sequential_handler_number = <value optimized out>
return_value_altered = 0
#21 0x00007ffff24c1bcc in IA__g_signal_emit_valist (instance=0x2164270,
signal_id=<value optimized out>, detail=0, var_args=0x7fffffffdd30) at
/build/buildd/glib2.0-2.22.2/gobject/gsignal.c:2990
return_value = {g_type = 20, data = {{v_int = 0, v_uint = 0,
v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double
= 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0,
v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float
= 0, v_double = 0, v_pointer = 0x0}}}
error = <value optimized out>
signal_return_type = 20
param_values = <value optimized out>
node = 0x1dbee50
i = <value optimized out>
n_params = <value optimized out>
__PRETTY_FUNCTION__ = "IA__g_signal_emit_valist"
#22 0x00007ffff24c2283 in IA__g_signal_emit (instance=0x7fffe15b19e0,
signal_id=0, detail=12847) at
/build/buildd/glib2.0-2.22.2/gobject/gsignal.c:3037
var_args = {{gp_offset = 32, fp_offset = 48, overflow_arg_area =
0x7fffffffde10, reg_save_area = 0x7fffffffdd50}}
#23 0x00007ffff2bd972f in gtk_widget_event_internal (widget=0x2164270,
event=0x21c7a60) at /build/buildd/gtk+2.0-2.18.3/gtk/gtkwidget.c:4767
signal_num = <value optimized out>
return_val = 0
#24 0x00007ffff2acacd3 in IA__gtk_propagate_event (widget=0x2164270,
event=0x21c7a60) at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c:2417
tmp = 0x0
handled_event = 35013232
__PRETTY_FUNCTION__ = "IA__gtk_propagate_event"
#25 0x00007ffff2acbca3 in IA__gtk_main_do_event (event=0x21c7a60) at
/build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c:1622
event_widget = <value optimized out>
grab_widget = 0x2164270
window_group = 0x21c6500
rewritten_event = 0x0
tmp_list = <value optimized out>
__PRETTY_FUNCTION__ = "IA__gtk_main_do_event"
#26 0x00007ffff2740cdc in gdk_event_dispatch (source=<value optimized
out>, callback=<value optimized out>, user_data=<value optimized out>)
at /build/buildd/gtk+2.0-2.18.3/gdk/x11/gdkevents-x11.c:2369
display = <value optimized out>
event = <value optimized out>
#27 0x00007ffff2212bbe in g_main_dispatch (context=0x1d6ddc0) at
/build/buildd/glib2.0-2.22.2/glib/gmain.c:1960
dispatch = 0x7ffff2740c90 <gdk_event_dispatch>
user_data = 0x0
callback = 0
cb_funcs = 0x0
cb_data = 0x0
current_source_link = {data = 0x1d6dd40, next = 0x0}
source = 0x1d6dd40
current = 0x1dea750
i = 0
#28 IA__g_main_context_dispatch (context=0x1d6ddc0) at
/build/buildd/glib2.0-2.22.2/glib/gmain.c:2513
---Type <return> to continue, or q <return> to quit---
No locals.
#29 0x00007ffff2216588 in g_main_context_iterate (context=0x1d6ddc0,
block=<value optimized out>, dispatch=<value optimized out>, self=<value
optimized out>)
at /build/buildd/glib2.0-2.22.2/glib/gmain.c:2591
max_priority = 0
timeout = 0
some_ready = 1
nfds = 7
allocated_nfds = -158001008
fds = <value optimized out>
__PRETTY_FUNCTION__ = "g_main_context_iterate"
#30 0x00007ffff22169e5 in IA__g_main_loop_run (loop=0x22fe720) at
/build/buildd/glib2.0-2.22.2/glib/gmain.c:2799
self = 0x1d1e930
__PRETTY_FUNCTION__ = "IA__g_main_loop_run"
#31 0x00007ffff2acc177 in IA__gtk_main () at
/build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c:1218
tmp_list = 0x22fef10
functions = 0x0
init = 0x7ffff6de4548
loop = <value optimized out>
#32 0x00007ffff696bb48 in wxEventLoop::Run (this=0x22fef10) at
../src/gtk/evtloop.cpp:76
__FUNCTION__ = "Run"
exitcode = <value optimized out>
#33 0x00007ffff69fbec8 in wxAppBase::MainLoop (this=0x1e16290) at
../src/common/appcmn.cpp:312
mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x22fef10}, m_pp =
0x1e16308, m_pOld = 0x0}
#34 0x00007ffff60513bc in wxEntry (argc=<value optimized out>, argv=<value
optimized out>) at ../src/common/init.cpp:460
No locals.
#35 0x0000000000589e63 in main (argc=1, argv=0x7fffffffe218) at
AudacityApp.cpp:594
No locals.
}}}
Threads 430 and 431 are probably the ones you care about -- Audacity's
thread 1 is waiting on 431, which is in a pthread_cond_wait(). 430 is in
a pthread_mutex_lock(), after releasing the mutex in poll_func. I don't
know what thread is holding the mutex -- it's not 431, as it's in a
pthread_cond_wait. Maybe 430 already had it somehow when it called
pthread_mutex_lock(). I'd be glad to look into this further but I don't
really know where to look at this point.
--
Ticket URL: <http://pulseaudio.org/ticket/703>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server
More information about the pulseaudio-bugs
mailing list