pulseaudio crashed with SIGABRT in raise() after manual reloading alsa

Bug #853560 reported by msutkowski
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Fix Released
Medium
David Henningsson

Bug Description

In order to listen any sound I have to do from console "sudo alsa reload".
After that i was trying to run virtualbox, which warned me, the resource (media) is occupied (or sth like that). Nevertheless it run. After a moment pulseaudio crashed.

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: pulseaudio 1:0.99.3-0ubuntu5
ProcVersionSignature: Ubuntu 3.0.0-11.18-generic 3.0.4
Uname: Linux 3.0.0-11-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: SB [HDA ATI SB], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 0/1
   Subdevice #0: subdevice #0
ApportVersion: 1.23-0ubuntu1
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: SB [HDA ATI SB], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D0', '/dev/snd/hwC0D1', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/timer'] failed with exit code 1:
Card0.Amixer.info:
 Card hw:0 'SB'/'HDA ATI SB at 0xc8100000 irq 16'
   Mixer name : 'Analog Devices AD1981'
   Components : 'HDA:11d41981,103c30c2,00100200 HDA:11c11040,103c1378,00100200'
   Controls : 11
   Simple ctrls : 9
Date: Mon Sep 19 02:30:56 2011
ExecutablePath: /usr/bin/pulseaudio
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64+mac (20110901)
ProcCmdline: /usr/bin/pulseaudio --start --log-target=syslog
ProcEnviron:
 PATH=(custom, no user)
 LANG=pl_PL.UTF-8
 SHELL=/bin/bash
Signal: 6
SourcePackage: pulseaudio
StacktraceTop:
 raise () from /lib/x86_64-linux-gnu/libc.so.6
 abort () from /lib/x86_64-linux-gnu/libc.so.6
 pa_fdsem_after_poll () from /usr/lib/libpulsecore-0.99.so
 pa_asyncq_write_after_poll () from /usr/lib/libpulsecore-0.99.so
 ?? () from /usr/lib/libpulsecore-0.99.so
Title: pulseaudio crashed with SIGABRT in raise()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin audio avahi backup cdrom dialout fax floppy libvirtd liquidsoap lpadmin netdev plugdev pulse pulse-access sambashare scanner syslog vboxusers video voice
dmi.bios.date: 11/25/2008
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 68YTT Ver. F.0E
dmi.board.name: 30C2
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 71.2D
dmi.chassis.asset.tag: CNU7311X5T
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr68YTTVer.F.0E:bd11/25/2008:svnHewlett-Packard:pnHPCompaq6715s(GC078ES#AKD):pvrF.0E:rvnHewlett-Packard:rn30C2:rvrKBCVersion71.2D:cvnHewlett-Packard:ct10:cvr:
dmi.product.name: HP Compaq 6715s (GC078ES#AKD)
dmi.product.version: F.0E
dmi.sys.vendor: Hewlett-Packard

Revision history for this message
msutkowski (michal-sutkowski) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 pa_fdsem_after_poll (f=0x25d3a90) at pulsecore/fdsem.c:315
 pa_asyncq_write_after_poll (l=0x25d3250) at pulsecore/asyncq.c:319
 asyncmsgq_read_cb (api=<optimized out>, e=<optimized out>, fd=<optimized out>, events=PA_IO_EVENT_INPUT, userdata=0x25d1a50) at pulsecore/thread-mq.c:45
 dispatch_pollfds (m=0x2595d10) at pulse/mainloop.c:679
 pa_mainloop_dispatch (m=0x2595d10) at pulse/mainloop.c:929

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in pulseaudio (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
visibility: private → public
Revision history for this message
David Henningsson (diwic) wrote :

Some notes:

#9 0x00007f5a4c6b096b in pa_fdsem_after_poll (f=0x25d3a90) at pulsecore/fdsem.c:315
        __func__ = "pa_fdsem_after_poll"
        __PRETTY_FUNCTION__ = "pa_fdsem_after_poll"
#10 0x00007f5a4c6a08fc in pa_asyncq_write_after_poll (l=0x25d3250) at pulsecore/asyncq.c:319
        __func__ = "pa_asyncq_write_after_poll"
        __PRETTY_FUNCTION__ = "pa_asyncq_write_after_poll"

#2 0x00007f5a4c6b0970 in pa_fdsem_after_poll (f=0x25d3a90) at pulsecore/fdsem.c:315
        __func__ = "pa_fdsem_after_poll"
        __PRETTY_FUNCTION__ = "pa_fdsem_after_poll"
#3 0x00007f5a4c6a08fc in pa_asyncq_write_after_poll (l=0x25d3250) at pulsecore/asyncq.c:319
        __func__ = "pa_asyncq_write_after_poll"
        __PRETTY_FUNCTION__ = "pa_asyncq_write_after_poll"

I assume, both threads should not call this 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.

Revision history for this message
David Henningsson (diwic) wrote : Thread message queue crash

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

Revision history for this message
David Henningsson (diwic) wrote :

I have now sent a patch for discussion upstream before I apply it to pulseaudio.

Changed in pulseaudio (Ubuntu):
assignee: nobody → David Henningsson (diwic)
status: New → In Progress
Revision history for this message
David Henningsson (diwic) wrote :

Applied upstream.

Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
David Henningsson (diwic) wrote :

Fixed in PulseAudio 1.0

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.