Summary: | unloading module-remap-sink while module-combine-sink is using it causes Assertion '*_head == _item' failed at modules/module-combine-sink.c:818, function output_remove_within_thread(). | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | Julius Michaelis <freebugs> |
Component: | modules | Assignee: | pulseaudio-bugs |
Status: | RESOLVED FIXED | QA Contact: | pulseaudio-bugs |
Severity: | normal | ||
Priority: | medium | CC: | lennart |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 96750 |
Description
Julius Michaelis
2016-11-06 17:58:57 UTC
Since this is a crash bug, I'm marking this as a release blocker. I was able to reproduce the crash with the provided script. In case someone else tries to reproduce this too, note that I first failed to reproduce when I issued the commands manually, so it's best to use the script. I would guess the manual commands failed to cause a crash, because the sinks had time to suspend before running the unload-module command. Here are my investigation results so far: When module-remap-sink is unloaded, it has to remove the virtual sink input that connects it to the master sink. When the "detach" callback of the sink input is called, module-remap-sink propagates the detach call to all sink inputs connected to it, so all sink inputs connected to the sink tree get detached. Then later, when module-combine-sink removes its virtual sink input, the detach callback gets called again. module-combine-sink assumes that the detach callback will be called only once, and the result of an incorrect assumption is a crash. I think it's reasonable to assume that the detach callback won't be called for streams that are already detached. I'll try if skipping the detach callback for already-detached sink inputs works. The fix works. While thinking about the problem, however, I realized that this situation with double-detaching should ideally not happen. I think the combine sink should remove its connection to the remap sink before the remap sink gets detached. Removing the combine sink's input involves sending messages to the root sink's IO thread, and doing that after the remap sink has detached feels unsafe and wrong. I'll submit the patch anyway - fixing the message sending problem would need substantial changes to all filter sinks, and I don't want to do that now. Patches submitted: https://patchwork.freedesktop.org/patch/126289/ https://patchwork.freedesktop.org/patch/126290/ https://patchwork.freedesktop.org/patch/126292/ https://patchwork.freedesktop.org/patch/126291/ I committed the patches now. |
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.