After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687265 - deadlock in libcanberra-pulse with gstreamer 1.0.2
deadlock in libcanberra-pulse with gstreamer 1.0.2
Status: RESOLVED NOTGNOME
Product: gnome-shell
Classification: Core
Component: general
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-10-31 13:06 UTC by Fabien Tassin
Modified: 2013-03-04 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
all threads bt (14.52 KB, text/plain)
2012-11-16 19:43 UTC, Fabien Tassin
Details

Description Fabien Tassin 2012-10-31 13:06:49 UTC
using g-s master (3.7.1 eb09f341), i'm getting a deadlock in libcanberra-pulse after changing workspaces a few times. I'm guessing any event triggering a (desktop) sound will do the same.

This is confirmed by gdb:

(gdb) bt
  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 144
  • #1 pa_threaded_mainloop_wait
    at pulse/thread-mainloop.c line 206
  • #2 pulse_driver_play
    from /usr/lib/x86_64-linux-gnu/libcanberra-0.30/libcanberra-pulse.so
  • #3 ca_context_play_full
    from /usr/lib/x86_64-linux-gnu/libcanberra.so.0
  • #4 ca_context_play
    from /usr/lib/x86_64-linux-gnu/libcanberra.so.0
  • #5 workspace_switch_sound
    at core/workspace.c line 498
  • #6 meta_workspace_activate_with_focus
    at core/workspace.c line 553
  • #7 ffi_call_unix64
    at src/x86/unix64.S line 75
  • #8 ffi_call
    at src/x86/ffi64.c line 485
  • #9 ??
    from /usr/lib/libgjs.so.0
  • #10 ??
    from /usr/lib/libgjs.so.0
  • #11 CallJSNative
    at jscntxtinlines.h line 701
  • #12 js::Invoke
    at jsinterp.cpp line 696
  • #13 js::Interpret
    at jsinterp.cpp line 4810
  • #14 js::RunScript
    at jsinterp.cpp line 653
  • #15 js::Invoke
    at jsinterp.cpp line 740
  • #16 js_fun_apply
    at jsfun.cpp line 2205
  • #17 CallJSNative
    at jscntxtinlines.h line 701
  • #18 js::Interpret
    at jsinterp.cpp line 4799
  • #19 js::RunScript
    at jsinterp.cpp line 653
  • #20 js::Invoke
    at jsinterp.cpp line 740
  • #21 js_fun_apply
    at jsfun.cpp line 2205
  • #22 CallJSNative
    at jscntxtinlines.h line 701
  • #23 js::Interpret
    at jsinterp.cpp line 4799
  • #24 js::RunScript
    at jsinterp.cpp line 653
  • #25 js::Invoke
    at jsinterp.cpp line 740
  • #26 js::CallOrConstructBoundFunction
    at jsfun.cpp line 2319
  • #27 CallJSNative
    at jscntxtinlines.h line 701
  • #28 js::Invoke
    at jsinterp.cpp line 703
  • #29 js::ExternalInvoke
    at jsinterp.cpp line 863
  • #30 JS_CallFunctionValue
    at jsapi.cpp line 5145
  • #31 ??
    from /usr/lib/libgjs.so.0
  • #32 ffi_closure_unix64_inner
    at src/x86/ffi64.c line 621
  • #33 ffi_closure_unix64
    at src/x86/unix64.S line 228
  • #34 process_event
    at core/keybindings.c line 1442
  • #35 meta_display_process_key_event
    at core/keybindings.c line 1684
  • #36 event_callback
    at core/display.c line 1970
  • #37 filter_func
    at ui/ui.c line 244
  • #38 gdk_event_apply_filters
    at /build/buildd/gtk+3.0-3.7.1+git20121024.019bb37d/./gdk/x11/gdkeventsource.c line 81
  • #39 gdk_event_source_translate_event
    at /build/buildd/gtk+3.0-3.7.1+git20121024.019bb37d/./gdk/x11/gdkeventsource.c line 195
  • #40 _gdk_x11_display_queue_events
    at /build/buildd/gtk+3.0-3.7.1+git20121024.019bb37d/./gdk/x11/gdkeventsource.c line 332
  • #41 gdk_display_get_event
    at /build/buildd/gtk+3.0-3.7.1+git20121024.019bb37d/./gdk/gdkdisplay.c line 310
  • #42 gdk_event_source_dispatch
    at /build/buildd/gtk+3.0-3.7.1+git20121024.019bb37d/./gdk/x11/gdkeventsource.c line 354
  • #43 g_main_dispatch
    at /build/buildd/glib2.0-2.35.1+git20121026.d68b4e1d/./glib/gmain.c line 2715
  • #44 g_main_context_dispatch
    at /build/buildd/glib2.0-2.35.1+git20121026.d68b4e1d/./glib/gmain.c line 3219
  • #45 g_main_context_iterate
    at /build/buildd/glib2.0-2.35.1+git20121026.d68b4e1d/./glib/gmain.c line 3290
  • #46 g_main_loop_run
    at /build/buildd/glib2.0-2.35.1+git20121026.d68b4e1d/./glib/gmain.c line 3484
  • #47 meta_run
    at core/main.c line 545
  • #48 main
    at main.c line 414

this is with libcanberra 0.30, pulseaudio 2.1 and gstreamer 1.0.2.
Comment 1 Fabien Tassin 2012-10-31 13:47:23 UTC
hm, I see workspace_switch_sound() is in mutter, not in g-s.

I'm using mutter from master (3.7.1 2cc0d31b) in case it matters.

this is a recent regression for me. My libcanberra & pulseaudio didn't change recently, but my gstreamer did (1.0.1 -> 1.0.2), not sure if it's related.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-10-31 14:16:35 UTC
Please file a bug in GStreamer.
Comment 3 Tim-Philipp Müller 2012-11-15 21:07:59 UTC
> Please file a bug in GStreamer.

I don't see anything GStreamer-related in that stack trace though?
Comment 4 Fabien Tassin 2012-11-16 11:02:57 UTC
indeed.

I downgraded gst from 1.0.2 to 1.0.1 and it seemed better for a while, but it didn't last. g-s is still freezing on the same libcanberra deadlock (when switching workspaces with the keyboard shotcuts).
I also tried downgrading canberra from 0.30 to 0.29, same thing.

I'm starting to suspect glib, I have 2.35.2.
Could be something like bug 686810
Comment 5 Fabien Tassin 2012-11-16 19:43:44 UTC
Created attachment 229179 [details]
all threads bt

attaching the all threads stacks of my current state (still with glib master) in case it helps.
Comment 6 Colin Walters 2012-11-21 02:02:45 UTC
I see this too in the latest gnome-ostree; as of this writing, git master of glib, gstreamer, libcanberra, gnome-shell, and pulseaudio-2.x branch.
Comment 7 Fabien Tassin 2012-11-21 20:04:31 UTC
I'm still seeing this g-s freeze many times a day with most of gnome from git master, but strangely, only on my x64 desktop. My 32bit desktop running the exact same git revisions seems immune to this.

I noticed rhythmbox is also deadlocking (also x64 only) when i pause/play it,
and that's in gst-pulse:

(gdb) bt
  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 144
  • #1 pa_threaded_mainloop_wait
    at pulse/thread-mainloop.c line 206
  • #2 gst_pulsering_set_corked
    at pulsesink.c line 1080
  • #3 gst_pulseringbuffer_pause
    at pulsesink.c line 1200

Comment 8 Alban Browaeys 2012-11-21 22:10:24 UTC
Downgrading libc6 from 2.16 to 2.13 have done the trick (required a rebuild of the items that I built after the upgrade so not iso but still looks likely the culprit).
Was achievable here as I just upgrade libc6 from debian experimental and had done build of only a handful items (not even libcanberra or pulseaudio which were the only items affected in my gnome-shell freeze. For rhtyhmbox I have the same issue if moving the position slider or when the song change. But this time the issue happens in gstreamer pulse plugin).
I guess for system already fully transitioned to libc6 2.16 , it would be easier to check on a 2.13 system and then upgrade only libc6 and retry.
Comment 9 Alban Browaeys 2012-12-03 11:03:43 UTC
This upstream glibc 2.16 bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=14417
libcanberra and gstreamer hangs on pulseaudio calls.

Upstream fixed this only in master at :
http://sourceware.org/git/?p=glibc.git;a=commit;h=c30e8edf7c56e55a81173da39f3e721ab17b9db6

Debian for example had reverted one upstream commit to avoid this issue (there was no upstream fix back then ... but only did for x86 not x86_64).
Thus I submitted http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694962 to them with a conversion of this upstream patch . This works well.
Comment 10 Tobias Wolf 2012-12-13 07:22:40 UTC
My workaround:

gsettings set org.gnome.desktop.sound event-sounds false
Comment 11 Colin Walters 2013-03-04 18:19:09 UTC
Confirmed that backporting http://sourceware.org/git/?p=glibc.git;a=commit;h=c30e8edf7c56e55a81173da39f3e721ab17b9db6 solves it.