Bug 76184

Summary: pulseaudio-5.0 - segfault on module load/unload
Product: PulseAudio Reporter: Alexander Tsoy <alexander>
Component: daemonAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: gnome, lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: backtrace
Fix 1/2
Fix 2/2
backtrace2
Another fix
Another fix

Description Alexander Tsoy 2014-03-14 16:39:52 UTC
Created attachment 95817 [details]
backtrace

pulseaudio-5.0 segfaults on startup when I login to the gnome session. BT is attached.
Comment 1 Alexander Tsoy 2014-03-14 16:50:27 UTC
My local default.pa:

$ cat ~/.config/pulse/default.pa 
#!/usr/bin/pulseaudio -nF

.include /etc/pulse/default.pa

.nofail
load-module module-tunnel-sink server=192.168.11.239
unload-module module-zeroconf-publish
.fail


So module-zeroconf-publish is loaded in global default.pa and then unloaded in the local one. Commenting out "unload-module module-zeroconf-publish" fixes segfaults.
Comment 2 Alexander Tsoy 2014-03-14 21:32:15 UTC
Another way to reproduce this crash:

$ echo -e 'load-module module-zeroconf-publish\nunload-module module-zeroconf-publish' | pacmd
Comment 3 Tanu Kaskinen 2014-03-15 07:40:06 UTC
Thanks for the report! I sent a couple of patches that should fix this bug to the mailing list (not yet reached the list at the time of writing), I'll attach them here also.
Comment 4 Tanu Kaskinen 2014-03-15 07:41:36 UTC
Created attachment 95840 [details] [review]
Fix 1/2
Comment 5 Tanu Kaskinen 2014-03-15 07:42:00 UTC
Created attachment 95841 [details] [review]
Fix 2/2
Comment 6 Alexander Tsoy 2014-03-17 10:05:10 UTC
Created attachment 95919 [details]
backtrace2

Thank you for the quick response! These patches fixed the crash of pulse at startup. However I still can reproduce the crash using command from comment 2. Attaching the new backtrace.
Comment 7 Tanu Kaskinen 2014-03-18 08:25:17 UTC
I'll attach another patch. It should finally fix also the pacmd test case.

module-zeroconf-publish appears to still have threading issues, but I couldn't reproduce the crash any more. I'll fix those remaining issues some time later.
Comment 8 Tanu Kaskinen 2014-03-18 08:25:51 UTC
Created attachment 95990 [details] [review]
Another fix
Comment 9 Tanu Kaskinen 2014-03-19 07:52:36 UTC
Created attachment 96028 [details] [review]
Another fix

The previous patch (the mainloop one) isn't the best way to fix the issue, here's a better patch.
Comment 10 Tanu Kaskinen 2014-03-28 13:09:42 UTC
The patches have now been committed.

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.