[pulsesink] abort at pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:118, function pa_mutex_unlock() with libc 2.21
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
Undecided
|
Adam Conrad | ||
gst-plugins-good1.0 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
pulseaudio (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
current build number: 146
device name: m75
channel: ubuntu-
last update: 2015-03-24 13:57:03
version version: 146
After libc 2.21 landed, pulsesink fails constantly when pausing or seeking the active pipeline.
Abort message:
Assertion 'pthread_
This is basically happens when it tries to unlock a mutex that is already unlocked.
This issue doesn't happen with libc 2.19.
To reproduce the issue:
GST_DEBUG=*pulse*:5 gst-launch-1.0 playbin uri=file:
Then when playing, just hit control+c, which will then pause the pipeline, causing the crash. The crash happens with most of the times you pause or seek the pipeline.
Related branches
affects: | libc (Ubuntu) → glibc (Ubuntu) |
description: | updated |
Changed in glibc (Ubuntu): | |
status: | Confirmed → Fix Committed |
assignee: | nobody → Adam Conrad (adconrad) |
tags: | added: lt-blocker lt-category-visible |
The mutex in question is the one used by pulse's mainloop, which gets used by pa_threaded_ mainloop_ lock, pa_threaded_ mainloop_ unlock and pa_threaded_ mainloop_ wait.
As the pulseaudio calls are all asynchronous, gst (pulsesink element) calls pa_threaded_ mainloop_ wait right after calling pulseaudio, so it can block the thread until pulseaudio returns via callback (which then calls pa_threaded_ mainloop_ signal, unblocking the thread).
The mutex is also recursive, allowing many lock and unlock calls to happen in parallel.
Follows the log when I'm able to reproduce the crash (with the mutex recursive count): mainloop_ lock -> mutex: 0xb5250e00 mainloop_ unlock -> mutex: 0xb5250e00 c:1272: gst_pulseringbu ffer_pause: <pulsesink1> Pausing and corking, before calling mainloop lock mainloop_ lock -> mutex: 0xb5250e00 c:1135: gst_pulsering_ set_corked: <pulsesink1> Setting corked state to 1 c:1142: gst_pulsering_ set_corked: <pulsesink1> Calling pa_threaded_ mainloop_ wait (PA_OPERATION_ RUNNING) mainloop_ wait -> cond: 0xb52517b8, mutex: 0xb5250e00
Interrupt: Stopping pipeline ...
Execution ended after 0:00:06.840520615
Setting pipeline to PAUSED ...
(thread id: 3069599744) pa_threaded_
(thread id: 3069599744) pa_mutex_lock -> m: 0xb5250e00 (count prev 0)
(thread id: 3069599744) pa_mutex_lock -> m: 0xb5250e00 (count new 1)
(thread id: 3069599744) pa_threaded_
(thread id: 3069599744) pa_mutex_unlock -> m: 0xb5250e00 (count prev 1)
(thread id: 3069599744) pa_mutex_unlock -> m: 0xb5250e00 (count new 0)
0:00:07.586470308 12439 0x15d1dc0 DEBUG pulse pulsesink.
(thread id: 3069599744) pa_threaded_
(thread id: 3069599744) pa_mutex_lock -> m: 0xb5250e00 (count prev 0)
(thread id: 3069599744) pa_mutex_lock -> m: 0xb5250e00 (count new 1)
0:00:07.586854770 12439 0x15d1dc0 DEBUG pulse pulsesink.
0:00:07.587025308 12439 0x15d1dc0 DEBUG pulse pulsesink.
(thread id: 3069599744) pa_threaded_
(thread id: 3069599744) pa_cond_wait -> m: 0xb5250e00 (count before wait 1)
(thread id: 3018630240) poll_func lock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count prev 0)
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count new 1)
(thread id: 3018630240) poll_func unlock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5250e00 (count prev 1)
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5250e00 (count new 0)
(thread id: 3018630240) poll_func lock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count prev 0)
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count new 1)
(thread id: 3018630240) poll_func unlock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5250e00 (count prev 1)
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5250e00 (count new 0)
(thread id: 3018630240) poll_func lock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count prev 0)
(thread id: 3018630240) pa_mutex_lock -> m: 0xb5250e00 (count new 1)
(thread id: 3018630240) poll_func unlock -> mutex: 0xb5250e00
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5250e00 (count prev 1)
(thread id: 3018630240) pa_mutex_unlock -> m: 0xb5...