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 629616 - crash in cogl when run firefox from overview
crash in cogl when run firefox from overview
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 630366 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-09-14 06:18 UTC by Maxim Ermilov
Modified: 2010-09-24 15:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
StThemeNodeTransition: work around Cogl bug (2.03 KB, patch)
2010-09-23 14:06 UTC, Owen Taylor
committed Details | Review
Revert "StThemeNodeTransition: work around Cogl bug" (1.93 KB, patch)
2010-09-24 07:32 UTC, drago01
committed Details | Review

Description Maxim Ermilov 2010-09-14 06:18:13 UTC
to reproduce:
1. open overview
2. type firefox; enter (don't crash if select it from APPLICATIONS menu)
3. crash

before crash appear warning:
(./cogl-material.c:676):_cogl_material_update_layers_cache: code should not be reached

appear after commit 862f1ea18ceee3e652c02303beee35a7c82120f5
Comment 1 Maxim Ermilov 2010-09-14 06:49:18 UTC
(gdb) bt
  • #0 _cogl_material_layer_pre_paint
    at ./cogl-material.c line 5090
  • #1 _cogl_rectangles_with_multitexture_coords
    at ./cogl-primitives.c line 566
  • #2 cogl_rectangle_with_multitexture_coords
    at ./cogl-primitives.c line 800
  • #3 st_theme_node_transition_paint
    at st/st-theme-node-transition.c line 330
  • #4 st_widget_paint
    at st/st-widget.c line 380
  • #5 st_bin_paint
    at st/st-bin.c line 116
  • #6 g_closure_invoke
    at gclosure.c line 766
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #8 g_signal_emit_valist
    at gsignal.c line 2983
  • #9 g_signal_emit
    at gsignal.c line 3040
  • #10 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #11 shell_generic_container_paint
    at shell-generic-container.c line 140
  • #12 g_closure_invoke
    at gclosure.c line 766
  • #13 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #14 g_signal_emit_valist
    at gsignal.c line 2983
  • #15 g_signal_emit
    at gsignal.c line 3040
  • #16 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #17 g_closure_invoke
    at gclosure.c line 766
  • #18 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #19 g_signal_emit_valist
    at gsignal.c line 2983
  • #20 g_signal_emit
    at gsignal.c line 3040
  • #21 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #22 g_closure_invoke
    at gclosure.c line 766
  • #23 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #24 g_signal_emit_valist
    at gsignal.c line 2983
  • #25 g_signal_emit
    at gsignal.c line 3040
  • #26 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #27 st_box_layout_paint
    at st/st-box-layout.c line 943
  • #28 g_closure_invoke
    at gclosure.c line 766
  • #29 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #30 g_signal_emit_valist
    at gsignal.c line 2983
  • #31 g_signal_emit
    at gsignal.c line 3040
  • #32 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #33 st_box_layout_paint
    at st/st-box-layout.c line 943
  • #34 g_closure_invoke
    at gclosure.c line 766
  • #35 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #36 g_signal_emit_valist
    at gsignal.c line 2983
  • #37 g_signal_emit
    at gsignal.c line 3040
  • #38 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #39 st_box_layout_paint
    at st/st-box-layout.c line 943
  • #40 g_closure_invoke
    at gclosure.c line 766
  • #41 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #42 g_signal_emit_valist
    at gsignal.c line 2983
  • #43 g_signal_emit
    at gsignal.c line 3040
  • #44 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #45 g_list_foreach
    at glist.c line 919
  • #46 g_closure_invoke
    at gclosure.c line 766
  • #47 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #48 g_signal_emit_valist
    at gsignal.c line 2983
  • #49 g_signal_emit
    at gsignal.c line 3040
  • #50 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #51 g_list_foreach
    at glist.c line 919
  • #52 clutter_group_real_paint
    at ./clutter-group.c line 281
  • #53 g_closure_invoke
    at gclosure.c line 766
  • #54 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #55 g_signal_emit_valist
    at gsignal.c line 2983
  • #56 g_signal_emit
    at gsignal.c line 3040
  • #57 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #58 g_list_foreach
    at glist.c line 919
  • #59 clutter_group_real_paint
    at ./clutter-group.c line 281
  • #60 g_closure_invoke
    at gclosure.c line 766
  • #61 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #62 g_signal_emit_valist
    at gsignal.c line 2983
  • #63 g_signal_emit
    at gsignal.c line 3040
  • #64 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #65 g_list_foreach
    at glist.c line 919
  • #66 clutter_group_real_paint
    at ./clutter-group.c line 281
  • #67 clutter_stage_paint
    at ./clutter-stage.c line 366
  • #68 g_closure_invoke
    at gclosure.c line 766
  • #69 signal_emit_unlocked_R
    at gsignal.c line 3290
  • #70 g_signal_emit_valist
    at gsignal.c line 2983
  • #71 g_signal_emit
    at gsignal.c line 3040
  • #72 clutter_actor_paint
    at ./clutter-actor.c line 2479
  • #73 _clutter_stage_glx_redraw
    at clutter-stage-glx.c line 539
  • #74 _clutter_do_redraw
    at ./clutter-main.c line 305
  • #75 _clutter_stage_do_update
    at ./clutter-stage.c line 693
  • #76 clutter_clock_dispatch
    at ./clutter-master-clock.c line 376
  • #77 g_main_dispatch
    at gmain.c line 2149
  • #78 g_main_context_dispatch
    at gmain.c line 2702
  • #79 g_main_context_iterate
    at gmain.c line 2780
  • #80 g_main_loop_run
    at gmain.c line 2988
  • #81 main
    at core/main.c line 725

Comment 2 drago01 2010-09-14 20:18:00 UTC
I can reproduce that here ...
Comment 3 Florian Müllner 2010-09-14 20:49:01 UTC
(In reply to comment #2)
> I can reproduce that here ...

Maxim: are you on nvidia as well? I cannot reproduce on intel ...
Comment 4 drago01 2010-09-14 20:58:50 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I can reproduce that here ...
> 
> Maxim: are you on nvidia as well? I cannot reproduce on intel ...

I can reproduce it on both intel and nvidia ...
Comment 5 Maxim Ermilov 2010-09-15 05:41:39 UTC
(In reply to comment #3)
> Maxim: are you on nvidia as well? I cannot reproduce on intel ...
yes. nvidia 195.36.31.
Fedora 13 x86_64
Comment 6 Maxim Ermilov 2010-09-23 11:09:38 UTC
*** Bug 630366 has been marked as a duplicate of this bug. ***
Comment 7 Owen Taylor 2010-09-23 13:49:56 UTC
This is a Cogl bug. What is basically going on is that if the opacity of a transitioning theme node changes during the transition, we change the primary color of the CoglMaterial, but don't touch the material layer

(http://git.gnome.org/browse/gnome-shell/tree/src/st/st-theme-node-transition.c#n325)

Cogl then:

 - Resets the parent of the material to point something different than the template material
 - Doesn't change material->n_layers

So we have a material with 3 layers, with local changes for only 2 layers, and a parent that has no layers. This is wrong, and causes an assertion failure and crash. At rough guess there are two separate Cogl problems here:

 - If you have a material with complicated layer state, changing the primary color of the material should *not* result in the parent getting reset; it should just record a local difference on the material.
 - If you are changing the parent, then you have to copy the layer state from the old parent to the material itself. (Maybe there's no case in which you want to change the parent when there are layers being inherited from the parent.)

Changing back to the way Florian had it originally (using the layer color rather the primary color) should work around this problem.
Comment 8 Owen Taylor 2010-09-23 14:06:23 UTC
Created attachment 170907 [details] [review]
StThemeNodeTransition: work around Cogl bug

Switch to using the layer combine constant rather than the material
primary color for representing the opacity of the material; this
avoids triggering a Cogl bug where changing the primary color corrupts
the layer state.
Comment 9 Florian Müllner 2010-09-23 14:40:37 UTC
Review of attachment 170907 [details] [review]:

Code looks good. I cannot reproduce the bug here (x86_64 only?), but Maxim confirmed on IRC that the fix works.
Comment 10 Owen Taylor 2010-09-23 16:46:52 UTC
Comment on attachment 170907 [details] [review]
StThemeNodeTransition: work around Cogl bug

Workaround pushed as
8f0f159960d1db92af35ebc6c144b3d1844f43b6

(From my debugging, I didn't see any particular reason it would be x86_64 specific - probably more specific sequence of operations - it occurs reliably when an app is launched with the keyboard (cal<return>) or whatever. I don't think it has anything at all to do with the app that is launched. It is conceivable that it is some 32/64 bit problem inside Cogl, I guess.)
Comment 11 Robert Bragg 2010-09-23 23:18:41 UTC
I've just pushed the following fix to Clutter that I think should fix the root cause of this bug:

Thanks to Owen's investigation that lead to the problem.

commit f834b8b138f1f405a7afa7e56560e4014f8bb990
Author: Robert Bragg <robert@linux.intel.com>
Date:   Thu Sep 23 22:18:42 2010 +0100

    material: Don't prune ancestry if it owns some layers
    
    Each time a material property changes we look to see if any of its
    ancestry has become redundant and if so we prune that redundant
    ancestry.
    
    There was a problem with the logic that handles this though because we
    weren't considering that a material which is a layer state authority may
    still defer to ancestors to define the state of individual layers.
    
    For example a material that derives from a parent with 5 layers can
    become a STATE_LAYERS authority by simply changing it's ->n_layers count
    to 4 and in that case it can still defer to its ancestors to define the
    state of those 4 layers.
    
    This patch checks first if a material is a layer state authority and if
    so only tries to prune its ancestry if it also *owns* all the individual
    layers it depends on. (I.e. if g_list_length
    (material->layer_differences) != material->n_layers then it's not safe
    to try pruning its ancestry!)
    
    http://bugzilla-attachments.gnome.org/attachment.cgi?id=170907
Comment 12 drago01 2010-09-24 07:31:06 UTC
(In reply to comment #11)
> I've just pushed the following fix to Clutter that I think should fix the root
> cause of this bug:

It indeed does.

Owen should we revert the workaround then?
Comment 13 drago01 2010-09-24 07:32:44 UTC
Created attachment 171002 [details] [review]
Revert "StThemeNodeTransition: work around Cogl bug"

This reverts commit 8f0f159960d1db92af35ebc6c144b3d1844f43b6.

Cogl has been fixed, so it is no longer needed.
Comment 14 Owen Taylor 2010-09-24 11:08:02 UTC
Review of attachment 171002 [details] [review]:

Yes, we should revert the workaround - there's almost no difference, but I liked the original way a little better.
Comment 15 drago01 2010-09-24 15:32:04 UTC
Attachment 171002 [details] pushed as 1413fa6 - Revert "StThemeNodeTransition: work around Cogl bug"