[pulseaudio-discuss] Thread message queue crash

David Henningsson david.henningsson at canonical.com
Thu Sep 22 04:41:03 PDT 2011


I'm trying to trace down a crash:

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/853560
https://launchpadlibrarian.net/80418699/ThreadStacktrace.txt

I'm seeing that both threads call "pa_asyncq_write_after_poll" 
simultaneously on the same object, which is module-null-sink's 
thread_mq->outq. The outq writes in the thread and reads from the main 
thread. Therefore it seems like the main thread should not call 
write_after_poll. From what I can see, there almost seems to be a typo 
in asyncmsgq_read_cb (see suggested patch below).

But since this is deep down, has been there for three years without 
causing trouble in the past (for what we know), I'd like a second 
opinion before actually applying this patch. I've just run a a quick 
test here and it didn't seem to break anything.

diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index 51fb765..b492793 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -42,7 +42,7 @@ static void asyncmsgq_read_cb(pa_mainloop_api*api, 
pa_io_event* e, int fd, pa_io
      pa_assert(events == PA_IO_EVENT_INPUT);

      pa_asyncmsgq_ref(aq = q->outq);
-    pa_asyncmsgq_write_after_poll(aq);
+    pa_asyncmsgq_read_after_poll(aq);

      for (;;) {
          pa_msgobject *object;



-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list