Comment 3 for bug 1795774

Revision history for this message
Gert van de Kraats (gkraats) wrote : Re: gnome-shell crashed with SIGSEGV in cogl_texture_get_height() from clutter_offscreen_effect_real_paint_target() from clutter_offscreen_effect_paint_texture() from clutter_offscreen_effect_paint() from clutter_actor_continue_paint()

Problem can be solved at update_fbo() within clutter/clutter/clutter-offscreen-effect.c

In this case at update_fbo a texture should be alocated with width 2560 which is greater than maximal size 2048 of graphics cards.
Offscreen-effect does not support sliced textures, so this is impossible and fails.

Crash occurs because no texture is allocated but a framebuffer is present at priv->offscreen.
Code to free the framebuffer at priv->offscreen should be moved upwards at update_fbo, because it also should be executed in case texture allocation fails.
This leads to the fillowing proposed code:

  if (priv->texture != NULL)
    {
      cogl_handle_unref (priv->texture);
      priv->texture = NULL;
    }
  if (priv->offscreen != NULL)
    {
      cogl_handle_unref (priv->offscreen);
      priv->offscreen = NULL;
    }

  priv->texture =
    clutter_offscreen_effect_create_texture (self, fbo_width, fbo_height);
  if (priv->texture == NULL)
    return FALSE;

  cogl_pipeline_set_layer_texture (priv->target, 0, priv->texture);

  priv->fbo_width = fbo_width;
  priv->fbo_height = fbo_height;

  priv->offscreen = cogl_offscreen_new_to_texture (priv->texture);

Remember bug 1790525 also should be solved (which often causes an earlier crash), to make the solution complete.