pulseaudio crashed with SIGABRT in pa_sink_input_assert_ref() from pa_sink_input_finish_move() from pa_sink_move_all_finish() from card_set_profile() from pa_card_set_profile

Bug #1556439 reported by Anders Pamdal
80
This bug affects 10 people
Affects Status Importance Assigned to Milestone
PulseAudio
Fix Released
High
pulseaudio (Ubuntu)
Fix Released
High
Unassigned
Bionic
Fix Released
High
Daniel van Vugt
Cosmic
Fix Released
High
Unassigned
Disco
Fix Released
High
Unassigned
Eoan
Fix Released
High
Unassigned

Bug Description

[Impact]

https://errors.ubuntu.com/problem/a83a007593c81501c4fbb4e9ac0f47e0b3880d17

This is one of the top pulseaudio crashes in Ubuntu 18.04 according to:
https://errors.ubuntu.com/?release=Ubuntu%2018.04&package=pulseaudio&period=year

[Test Case]

No manual test case known. Just watch errors.ubuntu.com to check for recurrences.

[Regression Potential]

Low. The fix is already in PulseAudio 12 so has been used in Ubuntu 18.10 and later for a year so far.

[Original Report]

Changing between Logitech G933 digital and analog and Logitech G930 digital and analog

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: pulseaudio 1:8.0-0ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-12.28-generic 4.4.4
Uname: Linux 4.4.0-12-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_modeset wl nvidia
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Mar 12 17:20:34 2016
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/pulseaudio
InstallationDate: Installed on 2016-02-22 (19 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
ProcCmdline: /usr/bin/pulseaudio --start --log-target=syslog
ProcEnviron:
 PATH=(custom, no user)
 SHELL=/bin/bash
 LANG=sv_SE.UTF-8
 LANGUAGE=sv
 XDG_RUNTIME_DIR=<set>
Signal: 6
SourcePackage: pulseaudio
StacktraceTop:
 pa_sink_input_finish_move () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-8.0.so
 pa_sink_move_all_finish () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-8.0.so
 ?? () from /usr/lib/pulse-8.0/modules/module-alsa-card.so
 pa_card_set_profile () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecore-8.0.so
 ?? () from /usr/lib/pulse-8.0/modules/libprotocol-native.so
Title: pulseaudio crashed with SIGABRT in pa_sink_input_finish_move()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
dmi.bios.date: 09/30/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 2001
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: X99-DELUXE
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr2001:bd09/30/2015:svnASUS:pnAllSeries:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnX99-DELUXE:rvrRev1.xx:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: All Series
dmi.product.version: System Version
dmi.sys.vendor: ASUS

Revision history for this message
Anders Pamdal (anders-pamdal) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 pa_sink_input_assert_ref (o=<optimized out>) at ./pulsecore/sink-input.h:257
 pa_sink_input_finish_move (i=i@entry=0xe2db20, dest=dest@entry=0xd8e0e0, save=save@entry=false) at pulsecore/sink-input.c:1753
 pa_sink_move_all_finish (s=0xd8e0e0, q=q@entry=0xe96de0, save=save@entry=false) at pulsecore/sink.c:918
 card_set_profile (c=0xe2c7f0, new_profile=0xd648c0) at modules/alsa/module-alsa-card.c:255
 pa_card_set_profile (c=c@entry=0xe2c7f0, profile=profile@entry=0xd648c0, save=save@entry=true) at pulsecore/card.c:296

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in pulseaudio (Ubuntu):
importance: Undecided → Medium
summary: - pulseaudio crashed with SIGABRT in pa_sink_input_finish_move()
+ pulseaudio crashed with SIGABRT in pa_sink_input_assert_ref()
tags: removed: need-amd64-retrace
tags: added: zesty
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: pulseaudio crashed with SIGABRT in pa_sink_input_assert_ref()

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
information type: Private → Public
description: updated
Changed in pulseaudio (Ubuntu):
importance: Medium → High
tags: added: artful yakkety
summary: - pulseaudio crashed with SIGABRT in pa_sink_input_assert_ref()
+ pulseaudio crashed with SIGABRT in pa_sink_input_assert_ref() from
+ pa_sink_input_finish_move() from pa_sink_move_all_finish() from
+ card_set_profile() from pa_card_set_profile
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This crash appears to be a more modern version of bug 981149.

Up to and including 14.04: bug 981149
14.10 and after: this bug.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bumped importance to reflect the high frequency with which this crash is occurring in recent Ubuntu releases:
https://errors.ubuntu.com/?package=pulseaudio&period=month

Changed in pulseaudio (Ubuntu):
importance: High → Critical
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in pulseaudio (Ubuntu):
importance: Critical → High
Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

Created attachment 135481
gdb backtrace

Description of problem:
pulseaudio aborts unexpectedly at sink-input.c several times per day.

Version-Release number of selected component (if applicable):
pulseaudio-11.1

How reproducible:
I do not use any audio devices. I have no audio devices connected to the audio outputs. I do not use audio at this machine at all, but pulseaudio aborts regularly several times per day.

Steps to Reproduce:
1) wait about one hour for pulseaudio to quit unexpectedly

Actual results (from syslog):

Nov 09 08:28:44 gklab-124-124 pulseaudio[8775]: [pulseaudio] sink-input.c: Assertion 'PA_SINK_INPUT_IS_LINKED(i->state)' failed at pulsecore/sink-input.c:1883, function pa_sink_input_finish_move(). Aborting.

Expected results:
pulseaudio does not abort unexpectedly

Additional info:
$ ps aux | grep pulseaudio
gdm 1284 0.0 0.0 1248200 11024 ? S<l 13:03 0:00 /usr/bin/pulseaudio --start --log-target=syslog
ldorau 10241 0.6 0.0 1285868 12124 ? S<l 14:49 0:00 /usr/bin/pulseaudio --start --log-target=syslog

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

Created attachment 135482
journalctl log with debug log level

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :
Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

It happened __103__ times on my machine during the last month.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Marking as a release blocker.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Alsa is reporting that headphones are repeatedly plugged in and out, and that makes pulseaudio switch between headphones and spdif output. I'd guess that's a hardware defect. You can work around the problem by commenting out module-switch-on-port-available in /etc/pulse/default.pa. That will stop the output switching.

The crash seems to happen when a stream (in this case a bell sound from gnome shell) stops during an output switch. I don't know how that's possible, I'll continue investigation later.

Revision history for this message
In , Georg Chini (gchini) wrote :

I think the problem is that the sink input is unlinked somewhere between pa_sink_move_all_start() and pa_sink_move_all_finish(). The simple solution is to check the state of the sink input in pa_sink_move_all_finish() and ignore the sink input if it is already unlinked. A patch for this can be found here: https://patchwork.freedesktop.org/patch/191580/. Could you test if this fixes the issue?

However, I am not sure if this is the right way to solve the problem. Tanu, what do you think?

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to Georg Chini from comment #6)
> However, I am not sure if this is the right way to solve the problem. Tanu,
> what do you think?

The patch seems good. I still wonder what's really happening here, though. I think it's not possible for the stream to end during the profile switch, because after detaching from the old sink, no more audio is consumed from the stream before it's attached to the new sink. Does something call pa_sink_input_kill()?

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

I checked all pa_sink_input_unlink() and pa_sink_input_kill() calls, and I didn't notice anything that could cause a sink input to be unlinked while it's being moved, so it looks like this crash should be impossible... Oh well, there's a fix and the fix seems sensible in any case, so I'm not going to spend more time on this (unless it's reported that the fix doesn't help).

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :
Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

I can test any debug/test version - if you want to, just let me know.

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

(In reply to Tanu Kaskinen from comment #5)
> Alsa is reporting that headphones are repeatedly plugged in and out, and
> that makes pulseaudio switch between headphones and spdif output. I'd guess
> that's a hardware defect. You can work around the problem by commenting out
> module-switch-on-port-available in /etc/pulse/default.pa. That will stop the
> output switching.
>

Of course I do not plug in or out anything, so it really can be a hardware defect.

I have just commented out the 'load-module-switch-on-port-available' in /etc/pulse/default.pa. Let's see if it helps...

Revision history for this message
In , Georg Chini (gchini) wrote :

It would be good if you could also verify that PA does not crash anymore with the patch applied and without disabling module-switch-on-port-available. The patch is in master now, so you can use current git.

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

It is not easy to verify this patch. The bug reproduces only with the binary pulseaudio-11.1-6.fc26 rpm installed. I have built the pulseaudio-11.1-6.fc26 package from sources and the bug does not reproduce. It does not reproduce also with pulseaudio built from the git repo without the patch.

I tested the new pulseaudio-11.1-7.fc26 binary package with the patch and it works well.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

Thanks for the information, Lukasz.

Georg's patch is now in master, I'll close this bug.

Revision history for this message
In , Lukasz-dev-dorau (lukasz-dev-dorau) wrote :

Thanks for the fix!

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Pulseaudio kept crashing for me in zesty and artful (see bug 1675892), but no longer seems to crash for me in bionic beta.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It appears this crash is still happening for a handful of people in bionic. But it's not very many:

https://errors.ubuntu.com/problem/a83a007593c81501c4fbb4e9ac0f47e0b3880d17

tags: added: bionic
Revision history for this message
Stdedos (stdedos) wrote :

Reproduced in xenial by:
Swapping "quickly enough" between input sources of the same headset (Corsair HS40 gives Analog and Digital output). Also crashed the settings sound dialog. In-between crashing, the enumerated sources doubled.

Changing the volume too fast (my volume control is a wheel: Dell Y-U0003-DEL5).

Revision history for this message
AzureRaptor (xrg-ubuntunineteen-10-spamviking) wrote :

I have the exact same symptoms in xenial as stdedos above, except with Corsair Vengeance 1500 headset, switching between digital/s/pdif and "speakers" (analog out).

I have not experienced the volume control symptom, however.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No crashes since we upgraded to PulseAudio 12, which means no crashes in Ubuntu 18.10 onward.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Fix Released
no longer affects: pulseaudio (Ubuntu Xenial)
no longer affects: pulseaudio (Ubuntu Bionic)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It looks like commit 59d264ac56d644f626251daa44ef7b39a9a9fe03 was the fix for this.

Changed in pulseaudio (Ubuntu Bionic):
importance: Undecided → Medium
status: New → Triaged
importance: Medium → High
Changed in pulseaudio:
importance: Unknown → High
status: Unknown → Fix Released
Changed in pulseaudio (Ubuntu Bionic):
assignee: nobody → Daniel van Vugt (vanvugt)
description: updated
description: updated
description: updated
description: updated
Changed in pulseaudio (Ubuntu Bionic):
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Debdiff for proposed SRU.

Changed in pulseaudio (Ubuntu Bionic):
status: In Progress → Fix Committed
Changed in pulseaudio (Ubuntu Disco):
status: New → Fix Released
Changed in pulseaudio (Ubuntu Cosmic):
status: New → Fix Released
importance: Undecided → High
Changed in pulseaudio (Ubuntu Disco):
importance: Undecided → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I've sponsored the Bionic SRU now

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I can't see the SRU anywhere yet...?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Anders, or anyone else affected,

Accepted pulseaudio into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:11.1-1ubuntu7.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-bionic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I've been using 1:11.1-1ubuntu7.3 for a couple of weeks already and have had no problems. But I would rather someone actually affected by this crash responds to comment #36.

Revision history for this message
Stdedos (stdedos) wrote :

My issue is in Xenial, so, no luck in testing that.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

There have been no reports of this crash in the proposed version:

https://errors.ubuntu.com/?release=Ubuntu%2018.04&package=pulseaudio&period=month&version=1%3A11.1-1ubuntu7.3

But related bug 1663528 is another story.

tags: added: verification-done-bionic
removed: verification-needed-bionic
tags: removed: artful yakkety zesty
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm going to drop the partial fix for bug 1663528 (or just not declare that ever fixed) and roll a new SRU version for this...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The new version of the SRU is in bug 1834138.

Revision history for this message
Chris Halse Rogers (raof) wrote : Proposed package upload rejected

An upload of pulseaudio to bionic-proposed has been rejected from the upload queue for the following reason: "The changes file claims to fix #1663528, but this won't. We don't need to preserve the changelog of -proposed packages, so drop it from the 1ubuntu7.3 entry".

Revision history for this message
Sebastien Bacher (seb128) wrote :

Reuploaded without the bug number reference now

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Anders, or anyone else affected,

Accepted pulseaudio into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:11.1-1ubuntu7.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-bionic
removed: verification-done-bionic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Still monitoring for regressions:

https://errors.ubuntu.com/problem/a83a007593c81501c4fbb4e9ac0f47e0b3880d17

Everything looks OK right now. Give it a few more days or a week, then consider it verified.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Verified in version 1:11.1-1ubuntu7.4 best I can tell due to no crashes...

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:11.1-1ubuntu7.5

---------------
pulseaudio (1:11.1-1ubuntu7.5) bionic; urgency=medium

  * Update snap policy to make access to audio recording conditional on
    plugging the "pulseaudio" or "audio-record" interfaces (LP: #1781428):
    - 0700-modules-add-snappy-policy-module.patch: rewrite to query
      snapd for the client's plugged interfaces.
    - 0701-enable-snap-policy-module.patch: enable the module in the
      default configuration.
    - Build depend on libsnapd-glib-dev.
  * Remove module-trust-store patch set:
    - 0409-Trust-store-patch.patch: trimmed down to pulsecore changes.
    - 0410-Add-thread-to-activate-trust-store-interface.patch: removed.
    - 0417-increase-timeout-check-apparmor.patch: removed.

 -- James Henstridge <email address hidden> Wed, 05 Nov 2019 17:16:25 +0800

Changed in pulseaudio (Ubuntu Bionic):
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.