Xwayland crashed with SIGABRT in OsAbort() from ... from FatalError("wl_surface@429: error 2: Failed to create a texture for surface 429: Failed to create texture 2d due to size/format constraints\n")

Bug #1795760 reported by Gert van de Kraats
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
Medium
Gert van de Kraats
xorg-server (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

https://gitlab.gnome.org/GNOME/mutter/issues/453

---

This bug contains a crash related to bug 1795089.
Local code is used for libmutter, to solve bug 1790525 and to display buffersizes at module setup_spans at cogl/cogl/cogl-texture-2d-sliced.c and at module allocate_from_bitmap at cogl/cogl/driver/gl/cogl-texture-2d-gl.c .

Dual monitor is used without a monitors.xml files usable by gdm3 with wayland.

After logging in using ubuntu with wayland both screens are shown, but crash after a short time without user doing anything.

At syslog we see the displayed buffersizes which are too large before the crash:

Oct 2 23:57:42 Gert2 gnome-shell[2636]: GK_allocate_from_bitmap 2560 1024
Oct 2 23:57:42 Gert2 gnome-shell[2636]: GK_cogl_set_error Failed to create texture 2d due to size/format constraints
Oct 2 23:57:42 Gert2 gnome-shell[2636]: Failed to allocate texture: Failed to create texture 2d due to size/format constraints

ProblemType: Crash
DistroRelease: Ubuntu 18.10
Package: xwayland 2:1.20.1-3ubuntu1
ProcVersionSignature: Ubuntu 4.18.0-8.9-generic 4.18.7
Uname: Linux 4.18.0-8-generic i686
ApportVersion: 2.20.10-0ubuntu11
Architecture: i386
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 2 23:57:24 2018
DistUpgraded: Fresh install
DistroCodename: cosmic
DistroVariant: ubuntu
ExecutablePath: /usr/bin/Xwayland
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [8086:27a2] (rev 03) (prog-if 00 [VGA controller])
   Subsystem: Dell Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [1028:01c2]
   Subsystem: Dell Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller [1028:01c2]
MachineType: Dell Inc. Latitude D620
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcCmdline: /usr/bin/Xwayland :0 -rootless -terminate -accessx -core -listen 4 -listen 5 -displayfd 6
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.18.0-8-generic root=UUID=4ccc6cca-be3d-4471-9677-1012a53ebfd7 ro splash quiet vt.handoff=1
Signal: 6
SourcePackage: xorg-server
StacktraceTop:
 OsAbort ()
 ?? ()
 FatalError ()
 _start ()
Title: Xwayland crashed with SIGABRT in OsAbort()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
dmi.bios.date: 04/11/2006
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A02
dmi.board.name: 0TD761
dmi.board.vendor: Dell Inc.
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA02:bd04/11/2006:svnDellInc.:pnLatitudeD620:pvr:rvnDellInc.:rn0TD761:rvr:cvnDellInc.:ct8:cvr:
dmi.product.name: Latitude D620
dmi.sys.vendor: Dell Inc.
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.94-1
version.libgl1-mesa-dri: libgl1-mesa-dri 18.2.1-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx 18.2.1-1ubuntu1
version.xserver-xorg-core: xserver-xorg-core 2:1.20.1-3ubuntu1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:18.1.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20171229-1build1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.15-3

Revision history for this message
Gert van de Kraats (gkraats) wrote :
description: updated
description: updated
description: updated
Revision history for this message
Apport retracing service (apport) wrote : This bug is a duplicate

Thank you for taking the time to report this crash and helping to make this software better. This particular crash has already been reported and is a duplicate of bug #1745799, so is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Please continue to report any other bugs you may find.

information type: Private → Public
tags: removed: need-i386-retrace
Revision history for this message
Gert van de Kraats (gkraats) wrote : Re: Xwayland crashed with SIGABRT in OsAbort()

I do not think this is a duplicate of bug #1745799.
At this comment I will try to give a code to solve this bug.
My symbol Xwaylnd-crash shows the next trace:
 #6 0x0062b600 in FatalError (f=0x63704e "%s") at ../../../../os/log.c:1015
         args = 0xbf9c7844 "\\x\234\277"
         args2 = 0xbf9c7844 "\\x\234\277"
         beenhere = 1
 #7 0x004b6296 in xwl_log_handler (format=0xb7dc71ea "%s@%u: error %d: %s\n", args=0xbf9c7994 "\027uܷ\255\001") at ../../../../../hw/xwayland/xwayland.c:1137
         msg = "wl_surface@429: error 2: Failed to create a texture for surface 429: Failed to create texture 2d due to size/format constraints\n", '\000' <repeats 127 times>
 #8 0xb7dc5fef in wl_log (fmt=0xb7dc71ea "%s@%u: error %d: %s\n") at ../src/wayland-util.c:404

Problem can be solved by using slicing at shm_buffer_attach() at src/wayland/meta-wayland-buffer.c, if size of texture is too large for graphics card. Code for freeing the bitmap is now positioned after the if.

This results into the following code:
  texture = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmap));
  cogl_texture_set_components (COGL_TEXTURE (texture), components);

  if (!cogl_texture_allocate (COGL_TEXTURE (texture), error))
    {
      g_clear_pointer (&texture, cogl_object_unref);
      texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_from_bitmap (bitmap, COGL_TEXTURE_MAX_WASTE));
      cogl_texture_set_components (COGL_TEXTURE (texture), components);
      if (!cogl_texture_allocate (COGL_TEXTURE (texture), error))
        g_clear_pointer (&texture, cogl_object_unref);
    }

  wl_shm_buffer_end_access (shm_buffer);

  cogl_object_unref (bitmap);

  buffer->texture = texture;

This code is working and makes it possible to login with wayland with dual screen without any monitors.xml-config on small/old graphic cards.

Slicing is causing next message:
Oct 13 15:51:36 Gert2 gnome-shell[1994]: Skipping layers 1..n of your pipeline since the first layer is sliced. We don't currently support any multi-texturing with sliced textures but assume layer 0 is the most important to keep

Revision history for this message
Gert van de Kraats (gkraats) wrote :

Sorry,
Code was not quite complete.
It misses freeing the error.
New version:
 texture = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmap));
  cogl_texture_set_components (COGL_TEXTURE (texture), components);

  if (!cogl_texture_allocate (COGL_TEXTURE (texture), error))
    {
      g_clear_pointer (&texture, cogl_object_unref);
      cogl_error_free (*error);
      *error = NULL;
      texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_from_bitmap (bitmap, COGL_TEXTURE_MAX_WASTE));
      cogl_texture_set_components (COGL_TEXTURE (texture), components);
      if (!cogl_texture_allocate (COGL_TEXTURE (texture), error))
        g_clear_pointer (&texture, cogl_object_unref);
    }

  wl_shm_buffer_end_access (shm_buffer);

  cogl_object_unref (bitmap);

  buffer->texture = texture;

Revision history for this message
Gert van de Kraats (gkraats) wrote :

As stated above this bug report is not a duplicate and contains working code to solve the bug.
Using this code doesn ot give any risk to the main stream of the code, it only handles an exception.
I thought it might be a pleasure to get a solution for a problem.
PLease do something with it.

Revision history for this message
Gert van de Kraats (gkraats) wrote :

This is not a duplicate. It is a crash at OsAbort, but that is the only coincidence with #1745799.
The cause is different.
It contains a working solution.
PLease do something with it and do not mark it as duplicate.

summary: - Xwayland crashed with SIGABRT in OsAbort()
+ Xwayland crashed with SIGABRT in OsAbort() from ... from
+ FatalError("wl_surface@429: error 2: Failed to create a texture for
+ surface 429: Failed to create texture 2d due to size/format
+ constraints\n")
Revision history for this message
Gert van de Kraats (gkraats) wrote :

Because this bug no longer is marked as duplicate of #1745799, I now add the bug-fix (tested by me for a long time) to this bug.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Gert,

Could you please propose your patch to the mutter developers directly?

  https://gitlab.gnome.org/GNOME/mutter/merge_requests

Or if that's too much work, just start by reporting this bug to the mutter developers here:

  https://gitlab.gnome.org/GNOME/mutter/issues

Changed in mutter (Ubuntu):
status: New → Incomplete
Changed in xorg-server (Ubuntu):
status: New → Incomplete
Revision history for this message
Gert van de Kraats (gkraats) wrote :
description: updated
Changed in mutter (Ubuntu):
status: Incomplete → In Progress
assignee: nobody → Gert van de Kraats (gkraats)
importance: Undecided → Medium
Changed in xorg-server (Ubuntu):
status: Incomplete → New
Changed in mutter:
status: Unknown → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed in mutter 3.32.0

Changed in mutter (Ubuntu):
status: In Progress → Fix Released
Changed in xorg-server (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.