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 688197 - Dead lock of the shell
Dead lock of the shell
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 685369 692356 693407 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-12 18:16 UTC by Lionel Landwerlin
Modified: 2018-09-25 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lionel Landwerlin 2012-11-12 18:16:53 UTC
Once or twice a day, I'm ending up with a dead lock in the shell (whole screen frozen).
It never happened before 3.6.

I'm a little bit surprise that another thread also uses libnspr.

(gdb)  thread apply all bt

Thread 1 (Thread 0x7f51834e59a0 (LWP 29930))

  • #0 pthread_cond_wait
    from /lib/x86_64-linux-gnu/libpthread.so.0
  • #1 PR_WaitCondVar
    from /usr/lib/x86_64-linux-gnu/libnspr4.so
  • #2 ??
    from /usr/lib/libmozjs185.so.1.0
  • #3 ??
    from /usr/lib/libmozjs185.so.1.0
  • #4 ??
    from /usr/lib/libmozjs185.so.1.0
  • #5 ??
    from /usr/lib/libmozjs185.so.1.0
  • #6 ??
    from /usr/lib/libmozjs185.so.1.0
  • #7 ??
    from /usr/lib/libmozjs185.so.1.0
  • #8 ??
    from /usr/lib/libmozjs185.so.1.0
  • #9 ??
    from /usr/lib/libmozjs185.so.1.0
  • #10 ??
    from /usr/lib/libmozjs185.so.1.0
  • #11 ??
    from /usr/lib/libmozjs185.so.1.0
  • #12 ??
    from /usr/lib/libmozjs185.so.1.0
  • #13 ??
    from /usr/lib/libmozjs185.so.1.0
  • #14 ??
    from /usr/lib/libmozjs185.so.1.0
  • #15 ??
    from /usr/lib/libmozjs185.so.1.0
  • #16 ??
    from /usr/lib/libmozjs185.so.1.0
  • #17 JS_CallFunctionValue
    from /usr/lib/libmozjs185.so.1.0
  • #18 gjs_call_function_value
    from /usr/lib/libgjs.so.0
  • #19 gjs_closure_invoke
    from /usr/lib/libgjs.so.0
  • #20 ??
    from /usr/lib/libgjs.so.0
  • #21 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #22 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #23 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #24 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #25 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #26 clutter_actor_get_preferred_width
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #27 _st_actor_get_preferred_width
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #28 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #29 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #30 clutter_actor_get_preferred_width
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #31 _st_actor_get_preferred_width
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #32 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #33 clutter_actor_get_preferred_width
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #34 _st_actor_get_preferred_width
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #35 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #36 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #37 clutter_actor_get_preferred_width
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #38 clutter_actor_allocate
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #39 clutter_actor_allocate_align_fill
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #40 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #41 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #42 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #43 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #44 clutter_actor_allocate
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #45 clutter_actor_allocate_align_fill
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #46 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #47 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #48 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #49 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #50 clutter_actor_allocate
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #51 clutter_actor_allocate_preferred_size
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #52 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.5
  • #53 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.5
  • #54 ??
    from /usr/lib/libgjs.so.0
  • #55 ??
    from /usr/lib/libgjs.so.0
  • #56 ??
    from /usr/lib/libmozjs185.so.1.0
  • #57 ??
    from /usr/lib/libmozjs185.so.1.0
  • #58 ??
    from /usr/lib/libmozjs185.so.1.0
  • #59 ??
    from /usr/lib/libmozjs185.so.1.0
  • #60 ??
    from /usr/lib/libmozjs185.so.1.0
  • #61 JS_CallFunctionValue
    from /usr/lib/libmozjs185.so.1.0
  • #62 gjs_call_function_value
    from /usr/lib/libgjs.so.0
  • #63 gjs_closure_invoke
    from /usr/lib/libgjs.so.0
  • #64 ??
    from /usr/lib/libgjs.so.0
  • #65 g_closure_invoke
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #66 ??
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #67 g_signal_emit_valist
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #68 g_signal_emit
    from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  • #69 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #70 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #71 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #72 clutter_actor_allocate
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #73 clutter_actor_allocate_preferred_size
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #74 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #75 clutter_actor_set_allocation
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #76 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #77 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #78 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #79 clutter_actor_allocate
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #80 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #81 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #82 ??
    from /usr/lib/x86_64-linux-gnu/libclutter-1.0.so.0
  • #83 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #84 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #85 g_main_loop_run
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #86 meta_run
    from /usr/lib/libmutter.so.0
  • #87 ??
  • #88 __libc_start_main
    from /lib/x86_64-linux-gnu/libc.so.6
  • #89 ??
  • #90 ??
  • #91 ??
  • #92 ??
  • #93 ??
  • #94 ??

Comment 1 Giovanni Campagna 2012-11-12 18:25:40 UTC
The dead lock is happening by a GC triggered automatically on the main thread and the actual GC thread.
We saw these in the past, and solved them by not running the GC periodically. Now I'm increasingly convinced this is an actual SpiderMonkey bug.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-11-12 18:34:55 UTC
I am too. js185 is from 2010, so it's fairly old. There's apparently a js187 release right around the corner, but it's been right around the corner for a year and a half now.

I wonder if we should just give up and port gjs to JavaScriptCore like Andy Wingo wants us to do.
Comment 3 Lionel Landwerlin 2012-11-12 18:36:04 UTC
I've noticed the shell relies on a particular version of SpiderMonkey. Aren't we missing fixes from more recent version of SpiderMonkey?
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-11-12 18:38:59 UTC
We're using the latest version of SpiderMonkey. It's old, but it's the latest version.
Comment 5 Giovanni Campagna 2012-11-12 18:43:08 UTC
(In reply to comment #2)
> I wonder if we should just give up and port gjs to JavaScriptCore like Andy
> Wingo wants us to do.

I've been thinking of that lately, but it won't happen until we have
let [a,b] = array;
i.e. lexical scoping and destructuring assignment.
Also, we need a replacement for E4X too (working GMarkup? that might be a good idea on its own).

However, seeing that js 1.8.5 (Firefox 4!) is really the latest standalone SpiderMonkey version, maybe we could put some pressure to have those implemented in JSC?
Comment 6 Ray Strode [halfline] 2012-11-12 21:39:22 UTC
just to be sure, can you get a trace with debuginfo installed for nspr and spidermonkey?
Comment 7 Lionel Landwerlin 2012-11-13 10:17:12 UTC
I can only get debug symbols for nspr, not spidermonkey.
Comment 8 Lionel Landwerlin 2012-11-13 10:17:13 UTC
I can only get debug symbols for nspr, not spidermonkey.
Comment 9 sangu 2012-11-23 06:56:59 UTC
backtrace https://bugzilla.redhat.com/show_bug.cgi?id=878323#c1 similar issue?
Comment 10 Lionel Landwerlin 2012-11-23 11:28:33 UTC
Sounds like the same problem to me.
Comment 11 Giovanni Campagna 2012-12-13 23:12:59 UTC
*** Bug 685369 has been marked as a duplicate of this bug. ***
Comment 12 Maciej (Matthew) Piechotka 2012-12-20 21:21:50 UTC
> However, seeing that js 1.8.5 (Firefox 4!) is really the latest standalone
> SpiderMonkey version, maybe we could put some pressure to have those
> implemented in JSC?

Gentoo have spidermonkey 1.8.7 apparently standalone but not mentioned on webpage (unofficial release). IIRC it is not API/ABI compatible though.

(My guess is - if the upstream does not support spidermonkey that it would be better to move to jsc/v8. I belive this problem was risen when upstream dropped support for xulrunner).

(In reply to comment #6)
> just to be sure, can you get a trace with debuginfo installed for nspr and
> spidermonkey?

I get the trace in bug which was marked as duplicate (trace #231284). I guess it is the most detailed so far.
Comment 13 Maciej (Matthew) Piechotka 2013-01-23 19:07:51 UTC
(In reply to comment #12)
> > However, seeing that js 1.8.5 (Firefox 4!) is really the latest standalone
> > SpiderMonkey version, maybe we could put some pressure to have those
> > implemented in JSC?
> 
> Gentoo have spidermonkey 1.8.7 apparently standalone but not mentioned on
> webpage (unofficial release). IIRC it is not API/ABI compatible though.
> 
> (My guess is - if the upstream does not support spidermonkey that it would be
> better to move to jsc/v8. I belive this problem was risen when upstream dropped
> support for xulrunner).
> 

Does anyone knows what will be future after release of IonMonkey? 

PS. Is there any plan for solving this bug? I can reproduce the hangs at will (if I have a single program running gnome-shell crashes after unlocking screen and many times even during normal operations).
Comment 14 Giovanni Campagna 2013-01-24 08:36:48 UTC
*** Bug 692356 has been marked as a duplicate of this bug. ***
Comment 15 Wolfram 2013-01-24 09:17:36 UTC
> Is there any plan for solving this bug?
Looks like so: http://imagemacros.files.wordpress.com/2009/06/roomful.jpeg?w=720
Comment 16 Giovanni Campagna 2013-01-24 09:33:02 UTC
Wolfram, I hope that comment was not sarcastic, considering that gjs developers are active right now to make it possible to use js 1.8.8 (Firefox 17), which solves this issue and many more.
There is a branch (gjs/wip/mozjs-188) you can test, if you want to speedup the process.
Comment 17 Wolfram 2013-01-24 09:42:52 UTC
I didn't see mozjs 188 or -9999 in portage, so could you give me any directions to update to latest version?
Comment 18 Giovanni Campagna 2013-01-24 09:48:57 UTC
Indeed, there is no mozjs 188 official tarball, and we're working with firefox developers to have one (see bug 690982). Meanwhile, you can use ricotz's tarball from http://people.ubuntu.com/~ricotz/mozjs/
Comment 19 Wolfram 2013-01-24 10:05:45 UTC
Do anybody has ebuild for this version? I'm afraid of installing something without portage and doesn't able to implement ebuild for this library for now.
Comment 20 Maciej (Matthew) Piechotka 2013-01-24 10:07:13 UTC
(In reply to comment #16)
> Wolfram, I hope that comment was not sarcastic, considering that gjs developers
> are active right now to make it possible to use js 1.8.8 (Firefox 17), which
> solves this issue and many more.
> There is a branch (gjs/wip/mozjs-188) you can test, if you want to speedup the
> process.

Great. I'm sorry for the form of original question but WM crashing every half an hour or so makes user grumpy even if it is not bug in said WM - and no comments on bug might mean either that devs are busy fixing it or that are busy with other things.
Comment 21 Jasper St. Pierre (not reading bugmail) 2013-01-24 16:42:39 UTC
(In reply to comment #19)
> Do anybody has ebuild for this version? I'm afraid of installing something
> without portage and doesn't able to implement ebuild for this library for now.

You should be able to modify the ebuild for mozjs185 and update it to use the new tarball, and apply the three patches. If you're uncomfortable with the tarball as created, you can use the script provided to make one directly from the upstream mozilla-central repository, ff17-esr branch.
Comment 22 Maciej (Matthew) Piechotka 2013-01-31 20:38:15 UTC
I got repro on mozjs188:

Thread 1 (Thread 0x7ff2d84b6940 (LWP 25049))

  • #0 poll
    at ../sysdeps/unix/syscall-template.S line 81
  • #1 poll
    at /usr/include/bits/poll2.h line 46
  • #2 _xcb_conn_wait
    at /var/tmp/portage/x11-libs/libxcb-1.9/work/libxcb-1.9/src/xcb_conn.c line 414
  • #3 _xcb_out_send
    at /var/tmp/portage/x11-libs/libxcb-1.9/work/libxcb-1.9/src/xcb_out.c line 349
  • #4 xcb_writev
    at /var/tmp/portage/x11-libs/libxcb-1.9/work/libxcb-1.9/src/xcb_out.c line 297
  • #5 _XSend
    at /var/tmp/portage/x11-libs/libX11-1.5.0/work/libX11-1.5.0/src/xcb_io.c line 494
  • #6 XRenderCompositeTrapezoids
    at /var/tmp/portage/x11-libs/libXrender-0.9.7/work/libXrender-0.9.7/src/Trap.c line 67
  • #7 composite_traps
    at cairo-xlib-render-compositor.c line 1887
  • #8 clip_and_composite
    at cairo-traps-compositor.c line 1038
  • #9 clip_and_composite_traps
    at cairo-traps-compositor.c line 1819
  • #10 _cairo_traps_compositor_stroke
    at cairo-traps-compositor.c line 2181
  • #11 _cairo_compositor_stroke
    at cairo-compositor.c line 157
  • #12 _cairo_xlib_surface_stroke
    at cairo-xlib-surface.c line 1621
  • #13 _cairo_surface_stroke
    at cairo-surface.c line 2180
  • #14 _cairo_surface_stroke
    at cairo-surface.c line 2149
  • #15 _cairo_gstate_stroke
    at cairo-gstate.c line 1185
  • #16 _cairo_default_context_stroke
    at cairo-default-context.c line 1008
  • #17 INT_cairo_stroke
    at cairo.c line 2146
  • #18 meta_draw_op_draw_with_env
    at ui/theme.c line 3739
  • #19 meta_draw_op_list_draw_with_style
    at ui/theme.c line 4207
  • #20 meta_draw_op_draw_with_env
    at ui/theme.c line 4034
  • #21 meta_draw_op_list_draw_with_style
    at ui/theme.c line 4207
  • #22 meta_frame_style_draw_with_style
    at ui/theme.c line 4807
  • #23 meta_theme_draw_frame_with_style
    at ui/theme.c line 5476
  • #24 meta_frames_paint
    at ui/frames.c line 2014
  • #25 meta_frames_draw
    at ui/frames.c line 1893
  • #26 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #27 gtk_widget_draw_marshallerv
    at gtkwidget.c line 851
  • #28 _g_closure_invoke_va
    at gclosure.c line 840
  • #29 g_signal_emit_valist
    at gsignal.c line 3226
  • #30 g_signal_emit
    at gsignal.c line 3371
  • #31 _gtk_widget_draw_internal
    at gtkwidget.c line 5754
  • #32 _gtk_widget_draw_internal
    at gtkwidget.c line 5732
  • #33 gtk_widget_send_expose
    at gtkwidget.c line 6134
  • #34 gtk_main_do_event
    at gtkmain.c line 1635
  • #35 _gdk_window_process_updates_recurse
    at gdkwindow.c line 3880
  • #36 gdk_window_process_updates_internal
    at gdkwindow.c line 4066
  • #37 gdk_window_process_all_updates
    at gdkwindow.c line 4197
  • #38 gdk_window_update_idle
    at gdkwindow.c line 3815
  • #39 gdk_threads_dispatch
    at gdk.c line 788
  • #40 g_main_dispatch
    at gmain.c line 2784
  • #41 g_main_context_dispatch
    at gmain.c line 3288
  • #42 g_main_context_iterate
    at gmain.c line 3359
  • #43 g_main_context_iterate
    at gmain.c line 3296
  • #44 g_main_loop_run
    at gmain.c line 3553
  • #45 meta_run
    at core/main.c line 545
  • #46 main
    at main.c line 416

	Inferior 1 [process 25049] will be detached.

Quit anyway? (y or n) Detaching from program: /usr/bin/gnome-shell, process 25049
Comment 23 darkxst 2013-01-31 22:34:46 UTC
That does not appear to be a GC deadlock
Comment 24 Maciej (Matthew) Piechotka 2013-02-01 10:38:15 UTC
(In reply to comment #23)
> That does not appear to be a GC deadlock

Posted as bug #692991 .
Comment 25 Giovanni Campagna 2013-02-13 13:58:11 UTC
*** Bug 693407 has been marked as a duplicate of this bug. ***
Comment 26 Ray Strode [halfline] 2013-04-09 12:56:51 UTC
FWIW, we've fixed the GC deadlock in bug 670200
Comment 27 Travis Reitter 2013-04-15 16:09:17 UTC
(In reply to comment #2)
> I am too. js185 is from 2010, so it's fairly old. There's apparently a js187
> release right around the corner, but it's been right around the corner for a
> year and a half now.
> 
> I wonder if we should just give up and port gjs to JavaScriptCore like Andy
> Wingo wants us to do.

Honestly, I know this was just an tangent thought, but it would solve the (what seems to be fairly major) issue of an application pulling in a second JS engine just because it wants to show a WebKit canvas.

That'd be a nice bonus to getting more regular upstream releases.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-04-15 16:16:54 UTC
We use JS1.7/1.8 features that are part of ES6 but aren't implemented in JSC last I checked, like "let" and destructuring assignment.