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 673512 - gnome-shell crashed with SIGSEGV in magazine_chain_pop_head()
gnome-shell crashed with SIGSEGV in magazine_chain_pop_head()
Status: VERIFIED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-04-04 15:21 UTC by Fabien Tassin
Modified: 2012-04-05 08:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind logs (154.95 KB, text/plain)
2012-04-04 17:38 UTC, Fabien Tassin
  Details
st-theme-context: Make icon theme changes a bit more efficient (1.64 KB, patch)
2012-04-04 20:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-theme-context: Punt icon theme changes to an idle (1.65 KB, patch)
2012-04-04 20:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Fabien Tassin 2012-04-04 15:21:57 UTC
gnome-shell crashes when going to the Activities Overview after gtk-update-icon-cache is triggered.
It's not new, it started to crash months ago, but I don't remember exactly when :(  (I've already mentioned it on irc ~a month ago)

This happens a lot on Ubuntu, as gtk-update-icon-cache is automatically triggered by some (unrelated) packages during system upgrades.

I can also reproduce it just by changing the icon-theme.cache inode
(cp icon-theme.cache x ; mv x icon-theme.cache).

It seems to happen only on 32bit.

See https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/955845
listing all the dupes. Some are using the nvidia blob, but not all.

Here is a recent stack trace with 3.4+:

  • #0 magazine_chain_pop_head
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gslice.c line 532
  • #1 thread_memory_magazine1_alloc
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gslice.c line 835
  • #2 g_slice_alloc
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gslice.c line 994
  • #3 g_ptr_array_sized_new
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/garray.c line 884
  • #4 g_ptr_array_new
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/garray.c line 868
  • #5 _st_theme_get_matched_properties
    at st/st-theme.c line 980
  • #6 ensure_properties
    at st/st-theme-node.c line 336
  • #7 ensure_properties
    at st/st-theme-node.c line 327
  • #8 _st_theme_node_ensure_geometry
    at st/st-theme-node.c line 1379
  • #9 _st_theme_node_ensure_geometry
    at st/st-theme-node.c line 1370
  • #10 st_theme_node_geometry_equal
    at st/st-theme-node.c line 3444
  • #11 st_widget_recompute_style
    at st/st-widget.c line 1490
  • #12 st_widget_style_changed
    at st/st-widget.c line 502
  • #13 notify_children_of_style_change
    at st/st-widget.c line 469
  • #14 g_cclosure_marshal_VOID__VOIDv
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gmarshal.c line 115
  • #15 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 997
  • #16 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 840
  • #17 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3207
  • #18 g_signal_emit
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3352
  • #19 st_widget_recompute_style
    at st/st-widget.c line 1533
  • #20 st_widget_style_changed
    at st/st-widget.c line 502
  • #21 notify_children_of_style_change
    at st/st-widget.c line 469
  • #22 g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gmarshal.c line 85
  • #23 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 970
  • #24 g_closure_invoke
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 777
  • #25 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3585
  • #26 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3296
  • #27 g_signal_emit
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3352
  • #28 st_widget_recompute_style
    at st/st-widget.c line 1533
  • #29 st_widget_map
    at st/st-widget.c line 444
  • #30 clutter_actor_set_mapped
    at ./clutter-actor.c line 1144
  • #31 clutter_actor_update_map_state
    at ./clutter-actor.c line 1354
  • #32 clutter_actor_real_show
    at ./clutter-actor.c line 1525
  • #33 clutter_actor_real_show
    at ./clutter-actor.c line 1513
  • #34 g_cclosure_marshal_VOID__VOIDv
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gmarshal.c line 115
  • #35 g_type_class_meta_marshalv
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 997
  • #36 _g_closure_invoke_va
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 840
  • #37 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3207
  • #38 g_signal_emit
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3352
  • #39 clutter_actor_show
    at ./clutter-actor.c line 1605
  • #40 clutter_actor_show
    at ./clutter-actor.c line 1579
  • #41 ffi_call_SYSV
    at src/x86/sysv.S line 64
  • #42 ffi_call
    at src/x86/ffi.c line 303
  • #43 ??
    from /usr/lib/libgjs.so.0
  • #44 ??
    from /usr/lib/libgjs.so.0
  • #45 CallJSNative
    at jscntxtinlines.h line 701
  • #46 js::Invoke
    at jsinterp.cpp line 696
  • #47 js::Interpret
    at jsinterp.cpp line 4810
  • #48 js::RunScript
    at jsinterp.cpp line 653
  • #49 js::Invoke
    at jsinterp.cpp line 740
  • #50 js_fun_apply
    at jsfun.cpp line 2205
  • #51 CallJSNative
    at jscntxtinlines.h line 701
  • #52 js::Interpret
    at jsinterp.cpp line 4799
  • #53 js::RunScript
    at jsinterp.cpp line 653
  • #54 js::Invoke
    at jsinterp.cpp line 740
  • #55 js_fun_apply
    at jsfun.cpp line 2205
  • #56 CallJSNative
    at jscntxtinlines.h line 701
  • #57 js::Interpret
    at jsinterp.cpp line 4799
  • #58 js::RunScript
    at jsinterp.cpp line 653
  • #59 js::Invoke
    at jsinterp.cpp line 740
  • #60 js_fun_apply
    at jsfun.cpp line 2205
  • #61 CallJSNative
    at jscntxtinlines.h line 701
  • #62 js::Interpret
    at jsinterp.cpp line 4799
  • #63 js::RunScript
    at jsinterp.cpp line 653
  • #64 js::Invoke
    at jsinterp.cpp line 740
  • #65 js_fun_apply
    at jsfun.cpp line 2205
  • #66 CallJSNative
    at jscntxtinlines.h line 701
  • #67 js::Interpret
    at jsinterp.cpp line 4799
  • #68 js::RunScript
    at jsinterp.cpp line 653
  • #69 js::Invoke
    at jsinterp.cpp line 740
  • #70 js::CallOrConstructBoundFunction
    at jsfun.cpp line 2319
  • #71 CallJSNative
    at jscntxtinlines.h line 701
  • #72 js::Invoke
    at jsinterp.cpp line 703
  • #73 js::ExternalInvoke
    at jsinterp.cpp line 863
  • #74 JS_CallFunctionValue
    at jsapi.cpp line 5145
  • #75 gjs_call_function_value
    from /usr/lib/libgjs.so.0
  • #76 gjs_closure_invoke
    from /usr/lib/libgjs.so.0
  • #77 ??
    from /usr/lib/libgjs.so.0
  • #78 g_closure_invoke
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gclosure.c line 777
  • #79 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3547
  • #80 g_signal_emit_valist
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3306
  • #81 g_signal_emit
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./gobject/gsignal.c line 3352
  • #82 clutter_actor_event
    at ./clutter-actor.c line 12030
  • #83 emit_event
    at ./clutter-main.c line 2273
  • #84 emit_pointer_event
    at ./clutter-main.c line 2300
  • #85 _clutter_process_event_details
    at ./clutter-main.c line 2457
  • #86 _clutter_process_event
    at ./clutter-main.c line 2658
  • #87 _clutter_input_device_set_actor
    at ./clutter-input-device.c line 555
  • #88 _clutter_input_device_update
    at ./clutter-input-device.c line 742
  • #89 _clutter_process_event_details
    at ./clutter-main.c line 2576
  • #90 _clutter_process_event
    at ./clutter-main.c line 2658
  • #91 _clutter_stage_process_queued_events
    at ./clutter-stage.c line 1017
  • #92 master_clock_process_events
    at ./clutter-master-clock.c line 283
  • #93 clutter_clock_dispatch
    at ./clutter-master-clock.c line 513
  • #94 g_main_dispatch
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gmain.c line 2515
  • #95 g_main_context_dispatch
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gmain.c line 3052
  • #96 g_main_context_iterate
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gmain.c line 3123
  • #97 g_main_context_iterate
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gmain.c line 3060
  • #98 g_main_loop_run
    at /build/buildd/glib2.0-2.32.1~git20120401.bebbc690/./glib/gmain.c line 3317
  • #99 meta_run
    at core/main.c line 555
  • #100 main
    at main.c line 333

Disassembly:
=> 0x773416 <g_slice_alloc+486>:	mov    (%esi),%edx
   0x773418 <g_slice_alloc+488>:	mov    %edx,0x4(%eax)
   0x77341b <g_slice_alloc+491>:	mov    0x4(%edi),%eax
   0x77341e <g_slice_alloc+494>:	test   %eax,%eax
   0x773420 <g_slice_alloc+496>:	je     0x773280 <g_slice_alloc+80>
   0x773426 <g_slice_alloc+502>:	sub    $0x1,%eax
   0x773429 <g_slice_alloc+505>:	mov    %eax,0x4(%edi)
   0x77342c <g_slice_alloc+508>:	jmp    0x773280 <g_slice_alloc+80>
   0x773431 <g_slice_alloc+513>:	lea    0x0(%esi,%eiz,1),%esi
   0x773438 <g_slice_alloc+520>:	mov    0xa54(%ebx),%edx
   0x77343e <g_slice_alloc+526>:	test   %edx,%edx
   0x773440 <g_slice_alloc+528>:	jne    0x773276 <g_slice_alloc+70>
   0x773446 <g_slice_alloc+534>:	mov    0xa50(%ebx),%edx
   0x77344c <g_slice_alloc+540>:	sub    $0x18,%edx
   0x77344f <g_slice_alloc+543>:	shr    $0x3,%edx
   0x773452 <g_slice_alloc+546>:	cmp    %edx,%eax

Segfault happened at: 0x773416 <g_slice_alloc+486>:	mov    (%esi),%edx
PC (0x00773416) ok
source "(%esi)" (0x695f7473) not located in a known VMA region (needed readable region)!
destination "%edx" ok
Comment 1 Milan Bouchet-Valat 2012-04-04 16:36:46 UTC
Could you run the Shell in Valgrind and reproduce the crash? You need to install debugging symbols for gnome-shell, mutter, glib and clutter. Then, the command is:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck gnome-shell

Thanks!
Comment 2 Fabien Tassin 2012-04-04 17:38:10 UTC
Created attachment 211315 [details]
valgrind logs

sure. Here is it. Look inside for "FTA" marking where i tried to reproduce the crash.
Comment 3 Milan Bouchet-Valat 2012-04-04 18:11:12 UTC
Great!

All the invalid reads are similar, looks like we try to use an icon that has been freed from the cache:
==8510== Invalid read of size 1
==8510==    at 0x40880B9: load_gicon_with_colors (st-texture-cache.c:917)
==8510==    by 0x4088A6F: st_texture_cache_load_icon_name (st-texture-cache.c:1211)
==8510==    by 0x407A3B4: st_icon_update (st-icon.c:490)
==8510==    by 0x4556222: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:115)
==8510==    by 0x4552DB6: g_type_class_meta_marshalv (gclosure.c:997)
==8510==    by 0x4554706: _g_closure_invoke_va (gclosure.c:840)
==8510==    by 0x456DA08: g_signal_emit_valist (gsignal.c:3207)
==8510==    by 0x456E432: g_signal_emit (gsignal.c:3352)
==8510==    by 0x4099081: st_widget_recompute_style (st-widget.c:1533)
==8510==    by 0x4099275: st_widget_map (st-widget.c:444)
==8510==    by 0x5074522: clutter_actor_set_mapped (clutter-actor.c:1144)
==8510==    by 0x508026B: clutter_actor_update_map_state (clutter-actor.c:1354)
==8510==  Address 0x17791eeb is 19 bytes inside a block of size 20 free'd
==8510==    at 0x402B06C: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==8510==    by 0x45E3CCA: standard_free (gmem.c:98)
==8510==    by 0x45E3F4F: g_free (gmem.c:252)
==8510==    by 0x45F88FA: g_slice_free1 (gslice.c:1111)
==8510==    by 0x407B6B5: st_icon_colors_unref (st-icon-colors.c:75)
==8510==    by 0x408BC10: st_theme_node_dispose (st-theme-node.c:96)
==8510==    by 0x4559181: g_object_unref (gobject.c:2981)
==8510==    by 0x40992E5: st_widget_style_changed (st-widget.c:505)
==8510==    by 0x176A9D77: ???
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-04-04 20:26:04 UTC
Created attachment 211341 [details] [review]
st-theme-context: Make icon theme changes a bit more efficient

There's no need to destroy and recreate the root node for an icon theme
change. Just emit the CHANGED signal.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-04-04 20:26:07 UTC
Created attachment 211342 [details] [review]
st-theme-context: Punt icon theme changes to an idle

Icon theme change signals aren't noticed immediately, they're usually
noticed when trying to load an icon. Since icon theme changes cause a
style change, and most icon widgets try to re-load their texture during
a style change, this means that we get a stack like this:

  st_texture_cache_load_icon
  gtk_icon_theme_lookup_icon
  gtk_icon_theme_changed
  st_widget_style_changed
  st_texture_cache_load_icon

Rather than making every place that uses StTextureCache re-entrant,
punt the notifying of icon theme changes to an idle handler instead.
Comment 6 Owen Taylor 2012-04-04 20:41:51 UTC
Review of attachment 211341 [details] [review]:

Don't really see the point - we're going to recreate the rest of the theme nodes for the actor hierarchy - what's one more? (I don't really object to this patch, I just don't think it's measurable with a microscope)
Comment 7 Owen Taylor 2012-04-04 20:54:40 UTC
Review of attachment 211342 [details] [review]:

Looks good - I wouldn't have complained if you had just done the don't recreate-the-theme-node in this patch and not commented, so feel free to push the pair like this.

(From discussion on irc: don't make st_theme_context_changed() have the signature for an idle handler - the naming implies that it is "like a public function" even if it's static, so shouldnt't get a random return value)
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-04-05 03:26:24 UTC
Attachment 211341 [details] pushed as 00091a2 - st-theme-context: Make icon theme changes a bit more efficient
Attachment 211342 [details] pushed as 0a7968a - st-theme-context: Punt icon theme changes to an idle
Comment 9 Fabien Tassin 2012-04-05 08:53:46 UTC
Thanks. I confirm it no longer crashes.
Marking verified.