Bug 100277 - Pulseaudio crashes when changing output
Summary: Pulseaudio crashes when changing output
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 99067
  Show dependency treegraph
 
Reported: 2017-03-19 11:26 UTC by Łukasz Żarnowiecki
Modified: 2017-05-18 20:36 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
stacktrace (4.18 KB, text/plain)
2017-03-19 11:26 UTC, Łukasz Żarnowiecki
Details
pactl before crash (22.95 KB, text/plain)
2017-04-08 09:43 UTC, Łukasz Żarnowiecki
Details
stacktrace with debugging symbols (6.33 KB, text/plain)
2017-04-08 09:43 UTC, Łukasz Żarnowiecki
Details
pulseaudio-discuss-echo-cancel-Fix-segfault-during-profile-switch-v2.patch (1.41 KB, patch)
2017-04-24 09:35 UTC, Łukasz Żarnowiecki
Details | Splinter Review
new_stacktrace.txt (6.38 KB, text/plain)
2017-04-24 13:52 UTC, Łukasz Żarnowiecki
Details

Description Łukasz Żarnowiecki 2017-03-19 11:26:38 UTC
Created attachment 130308 [details]
stacktrace

Pulseaudio crashes almost everytime I switch output profile in plasma-pa.

Version 10.0
Comment 1 Tanu Kaskinen 2017-04-02 18:28:44 UTC
Since this is a crash bug, I'm marking this as a release blocker.

Some more information would be good to have:

Before the profile switch, what's the output of "pactl list"?

Which profile do you select?

Can you install debug symbols for pulseaudio to get a bit more informative backtrace?

Can you provide a verbose log? Instructions here: https://wiki.ubuntu.com/PulseAudio/Log

Those instructions tell you to disable autospawning in client.conf, but that doesn't work, if your distribution uses systemd to manage pulseaudio. To stop systemd from automatically starting pulseaudio, run these commands:

systemctl --user disable pulseaudio.socket
systemctl --user stop pulseaudio.socket pulseaudio.service

To undo those commands:

systemctl --user enable pulseaudio.socket
systemctl --user start pulseaudio.socket
Comment 2 Łukasz Żarnowiecki 2017-04-08 09:43:12 UTC
Created attachment 130755 [details]
pactl before crash
Comment 3 Łukasz Żarnowiecki 2017-04-08 09:43:44 UTC
Created attachment 130756 [details]
stacktrace with debugging symbols
Comment 4 Łukasz Żarnowiecki 2017-04-08 09:47:38 UTC
I am switching from hdmi-output-2 to output:analog-stereo

Sorry I did not turned on verbose logs yet.  Maybe you can figure out something from new stacktrace.

Thank you :)
Comment 5 Georg Chini 2017-04-23 16:59:29 UTC
Just cooked up a patch that hopefully solves the issue. Patch can be found here: 
https://patchwork.freedesktop.org/patch/152167/
Could you please test if works?
Comment 6 Łukasz Żarnowiecki 2017-04-24 09:35:32 UTC
Created attachment 130996 [details] [review]
pulseaudio-discuss-echo-cancel-Fix-segfault-during-profile-switch-v2.patch

Your patch does not apply cleanly on 10.0.  I made my own version.  Let me give a few days to test it and I will get back to you.

Thanks
Comment 7 Łukasz Żarnowiecki 2017-04-24 13:52:36 UTC
Created attachment 130998 [details]
new_stacktrace.txt

It happened again, but with different stacktrace
Comment 8 Georg Chini 2017-04-24 15:35:16 UTC
Could you try this one:
https://patchwork.freedesktop.org/patch/152436/
on top of the last one?
Comment 9 Georg Chini 2017-04-24 15:36:24 UTC
BTW, patches are against current git. Sorry.
Comment 10 Georg Chini 2017-04-24 16:03:55 UTC
Again sorry, I was too quick with the patch. There are other
places with the same bug. So forget it.I'll send a new patch
in a while.
Comment 11 Georg Chini 2017-04-24 17:38:34 UTC
OK, I hope I found all relevant places now. Here is the patch:
https://patchwork.freedesktop.org/patch/152461/
Please give it a try.
Comment 12 Georg Chini 2017-04-28 06:39:41 UTC
Did you already find some time to test the patch?
This bug is one of the blocker bugs for the next
PA release, so I would appreciate your feedback.
Comment 13 Łukasz Żarnowiecki 2017-05-01 14:01:50 UTC
Yes, I have not seen crashes after applying your patch.
Comment 14 Georg Chini 2017-05-01 14:40:07 UTC
Good news. Thanks for testing.
Comment 15 Łukasz Żarnowiecki 2017-05-11 10:44:07 UTC
Patch does not fix the problem.  It still happening with the same stacktrace.  I though maybe system update replaced some files, but I did fresh recompilation with patch applied on top of pulseaudio, full restart and it crashed several times already.
Comment 16 Georg Chini 2017-05-11 11:01:02 UTC
It turned out, that the patch was the wrong approach to fix the bug anyway. 

Please try using current git and apply the following two patches:
https://patchwork.freedesktop.org/patch/155160/
https://patchwork.freedesktop.org/patch/154921/

The second patch should fix the bug, but it will not work correctly without
the first patch.
Comment 17 Łukasz Żarnowiecki 2017-05-11 14:37:45 UTC
Patches does not apply on top of 10.  I think I will wait until pulseaudio 11.

Thank you for making pulseaudio better software.
Comment 18 Tanu Kaskinen 2017-05-18 20:36:43 UTC
The patches are now merged.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.