gnome-shell crashed with SIGSEGV in cogl_texture_get_height(texture=0x0) from clutter_offscreen_effect_real_paint_target() from clutter_offscreen_effect_paint_texture() from clutter_offscreen_effect_paint() from clutter_actor_continue_paint()

Bug #1795774 reported by errors.ubuntu.com bug bridge on 2018-10-03
30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mutter (Ubuntu)
Medium
Marco Trevisan (Treviño)
Bionic
Undecided
Marco Trevisan (Treviño)
Cosmic
Undecided
Marco Trevisan (Treviño)

Bug Description

[ Impact ]

Gnome shell crashes on cogl_texture_get_height

[ Test case ]

No clear reproducer is know for such issue, crashes should be monitored in e.u.c checking that this is not happening anymore for the version in proposed.

[ Regression potential ]

Low, the proposed fix is part of the current stable branch upstream and not changed in further revisions.

--

The Ubuntu Error Tracker has been receiving reports about a problem regarding gnome-shell. This problem was most recently seen with package version 3.30.0-1ubuntu2, the problem page at https://errors.ubuntu.com/problem/e5b2dcb04552882a76f1daa6b9f18ba864269d26 contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Related branches

summary: - /usr/bin/gnome-
- shell:11:cogl_texture_get_height:clutter_offscreen_effect_real_paint_target:clutter_offscreen_effect_paint_texture:clutter_offscreen_effect_paint:clutter_actor_continue_paint
+ 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()

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in gnome-shell (Ubuntu):
importance: Undecided → Medium
Changed in mutter (Ubuntu):
importance: Undecided → Medium
Gert van de Kraats (gkraats) wrote :

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.

Daniel van Vugt (vanvugt) wrote :

Thanks for that, Gert.

AFAIK mosts GPUs from the last decade support textures up to size 16384. And ideally all should at least support textures larger than the typical screen resolution they support. If your GL_MAX_TEXTURE_SIZE is 2048 then that's fairly old and uncommon. But certainly we should fix it.

My question is: what is the large actor 2560 pixels in size that the machine is trying to offscreen? It's also a performance bug (for all GPUs) if we're trying to offscreen any actor that large. Even if it doesn't crash, gnome-shell still shouldn't be doing that.

Since I am working in the area (https://gitlab.gnome.org/GNOME/mutter/merge_requests/117) the code is still fresh in my mind and I will try to implement your suggested fix. Thanks!

Changed in mutter (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
summary: - gnome-shell crashed with SIGSEGV in cogl_texture_get_height() from
- clutter_offscreen_effect_real_paint_target() from
+ gnome-shell crashed with SIGSEGV in cogl_texture_get_height(texture=0x0)
+ from clutter_offscreen_effect_real_paint_target() from
clutter_offscreen_effect_paint_texture() from
clutter_offscreen_effect_paint() from clutter_actor_continue_paint()
Changed in mutter (Ubuntu):
status: Confirmed → Triaged
Changed in mutter (Ubuntu):
status: Triaged → In Progress
Changed in mutter (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → Marco Trevisan (Treviño) (3v1n0)
Changed in gnome-shell (Ubuntu):
status: Confirmed → In Progress
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.30.2-5

---------------
mutter (3.30.2-5) unstable; urgency=medium

  * d/p/clutter-Avoid-rounding-compensation-when-invalidating-2D-.patch,
    d/p/clutter-Fix-offscreen-effect-painting-of-clones.patch:
    - Fix offscreen-effect painting of clones in zoom mode (LP: #1767648,
      LP: #1779615)
  * d/p/cogl-auto-texture-Avoid-a-double-free-crash.patch,
    d/p/clutter-offscreen-effect-Disable-if-no-texture.patch:
    - Fix crash in dual monitor setup and gdm activation (LP: #1790525,
      LP: #1795774)

 -- Marco Trevisan (Treviño) <email address hidden> Thu, 24 Jan 2019 18:00:14 +0000

Changed in mutter (Ubuntu):
status: In Progress → Fix Released
Iain Lane (laney) on 2019-01-25
Changed in mutter (Ubuntu Bionic):
status: New → In Progress
Changed in mutter (Ubuntu Cosmic):
status: New → In Progress
Changed in mutter (Ubuntu Bionic):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Changed in mutter (Ubuntu Cosmic):
assignee: nobody → Marco Trevisan (Treviño) (3v1n0)
Changed in gnome-shell (Ubuntu Bionic):
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in gnome-shell (Ubuntu Cosmic):
assignee: nobody → Daniel van Vugt (vanvugt)

Hello errors.ubuntu.com, or anyone else affected,

Accepted mutter into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mutter/3.30.2-1~ubuntu18.10.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mutter (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
no longer affects: gnome-shell (Ubuntu)
no longer affects: gnome-shell (Ubuntu Bionic)
no longer affects: gnome-shell (Ubuntu Cosmic)
Gert van de Kraats (gkraats) wrote :

Reinstalled current libmutter.
With dual monitor horizontal aside this problem could not be reproduced because
logon-session crashes before showing logon-screen, (caused by bug #1790525).

Installed proposed version:

apt list libmutter-3-0
Listing... Done
libmutter-3-0/cosmic-proposed,now 3.30.2-1~ubuntu18.10.3 i386 [installed]

No crash anymore when trying to suspend at logon-screen.
Problem is solved by proposed package. No new other problems detected.

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers