On 09/23/2011 04:59 PM, Colin Guthrie wrote:
'Twas brillig, and Maarten Bosmans at 23/09/11 09:48 did gyre and gimble:
2011/9/22 Colin Guthrie<[email protected]>:
'Twas brillig, and David Henningsson at 22/09/11 12:41 did gyre and gimble:
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.
As well as not breaking things, does it also fix the problem case?
Just from the patch posted, it does indeed look like a typo to me!
And from the commit that introduced it, it looks like a type too.
In 045c1d602dcba57868845ba3270510593c39480f merge glitch-free branch
back into trunk (damn you svn-merge commits)
pa_asyncmsgq_{before,after}_poll gets renamed to
pa_asyncmsgq_read_{before,after}_poll and
pa_asyncmsgq_write_{before,after}_poll is introduced. The conversion
was wrong there.
Seems conclusive enough. Want to make that a proper patch David?
Ok, here you go!
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
>From 9662bcae9c115f08a89ae4aea10c14e1fc342584 Mon Sep 17 00:00:00 2001
From: David Henningsson <[email protected]>
Date: Sun, 25 Sep 2011 11:07:47 +0200
Subject: [PATCH] Fix crash in threaded message queues
Once in a million or so, this typo causes a crash when two threads
simultaneously try to call "pa_asynqmsgq_write_poll".
BugLink: http://bugs.launchpad.net/bugs/853560
Signed-off-by: David Henningsson <[email protected]>
---
src/pulsecore/thread-mq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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;
--
1.7.5.4
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss