Proposed solution:

As the stacktrace below shows the problem is caused by  module 
cogl_texture_new_with_size at cogl/cogl/deprecated/cogl/auto-texture.c .
This module is trying to create a texture with size 2560 x 1024, which is by 
default is configured by gdm3 with wayland for 2 monitors.
This is not supported by graphics-card, causing error "Failed to create texture 
2d due to size/format constraints".
The error is freed by cogl_texture_new_with_size, but the variable skip_error 
is not set to NULL by the call to cogl_error_free (because the parameter is a 
copy).

Then module tries to allocate a slice with max_waste -1. This also fails, 
causing error "Sliced texture size of 2560 x 1024 not possible with max waste 
set to -1". 
Module cogl_set_error complains about the skip_error not being NULL with 
message "CoglError set...", but does not set a new value to skip_error.
Also the second error is programmed to be freed by cogl_error_free at 
cogl_texture_new_with_size, that in this way tries to free the same memory 
twice. This causes the crash "double free or corruption (fasttop)", unless by 
accident the same memory-address is allocated again.

To solve, the statement skip_error = NULL; should be added:
cogl_texture_new_with_size (unsigned int width,
                            unsigned int height,
                            CoglTextureFlags flags,
                            CoglPixelFormat internal_format)
{
  CoglTexture *tex;
  CoglError *skip_error = NULL;

  _COGL_GET_CONTEXT (ctx, NULL);

  if ((_cogl_util_is_pot (width) && _cogl_util_is_pot (height)) ||
      (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_BASIC) &&
       cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP)))
    {
      /* First try creating a fast-path non-sliced texture */
      tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));

      _cogl_texture_set_internal_format (tex, internal_format);

      if (!cogl_texture_allocate (tex, &skip_error))
        {
          cogl_error_free (skip_error);
          skip_error = NULL;


 
This solution is tested and solves the problem during startup and for right 
corner click.

Stacktrace with modulenames/linenumbers:
Package: gnome-shell 3.30.0-1ubuntu2
Stacktrace:
 #0  0xb7ef9d41 in __kernel_vsyscall ()
 #1  0xb6a4e512 in __libc_signal_restore_set (set=0xbfcb8a0c) at 
../sysdeps/unix/sysv/linux/internal-signals.h:84
         set = {__val = {0, 0, 1482184750, 5789784, 2237142784, 273, 273, 
3080022123, 3080956952, 16, 3080959932, 16, 3080023695, 16, 3217787612, 
3066097232, 3080956952, 3080959932, 19876880, 3217787612, 3080285386, 11, 0, 
3080023577, 3080285340, 3080956952, 16, 3080959932, 3080016471, 3217788168, 0, 
3217787712}}
         pid = <optimized out>
         tid = <optimized out>
         ret = 0
 #2  0xb6a4e512 in __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
         set = {__val = {0, 0, 1482184750, 5789784, 2237142784, 273, 273, 
3080022123, 3080956952, 16, 3080959932, 16, 3080023695, 16, 3217787612, 
3066097232, 3080956952, 3080959932, 19876880, 3217787612, 3080285386, 11, 0, 
3080023577, 3080285340, 3080956952, 16, 3080959932, 3080016471, 3217788168, 0, 
3217787712}}
         pid = <optimized out>
         tid = <optimized out>
         ret = 0
 #3  0xb6a382b6 in __GI_abort () at abort.c:79
         save_stage = 1
         act = {__sigaction_handler = {sa_handler = 0xb7996077 <g_vasprintf+7>, 
sa_sigaction = 0xb7996077 <g_vasprintf+7>}, sa_mask = {__val = {3080956952, 
3060745084, 3080120357, 3217787880, 3060745084, 3217788000, 32868, 20347328, 0, 
28984448, 2237142784, 3060745084, 3080120310, 3080956952, 3080956952, 
3217788408, 1024, 31097824, 3080018485, 3060691022, 16, 3060756628, 0, 3, 4096, 
3065078356, 2, 3066019840, 4096, 3217788168, 3064530671, 0}}, sa_flags = 4096, 
sa_restorer = 0x3}
         sigs = {__val = {32, 0 <repeats 31 times>}}
 #4  0xb6a9074c in __libc_message (action=do_abort, fmt=<optimized out>) at 
../sysdeps/posix/libc_fatal.c:181
         ap = <optimized out>
         fd = 2
         list = <optimized out>
         nlist = <optimized out>
         cp = <optimized out>
         written = <optimized out>
 #5  0xb6a975dd in malloc_printerr (str=str@entry=0xb6ba525c "double free or 
corruption (fasttop)") at malloc.c:5336
 #6  0xb6a98e6f in _int_free (av=<optimized out>, p=<optimized out>, 
have_lock=<optimized out>) at malloc.c:4216
         idx = 6
         old = <optimized out>
         old2 = <optimized out>
         size = <optimized out>
         fb = <optimized out>
         nextchunk = <optimized out>
         nextsize = <optimized out>
         nextinuse = <optimized out>
         prevsize = <optimized out>
         bck = <optimized out>
         fwd = <optimized out>
         __PRETTY_FUNCTION__ = "_int_free"
 #7  0xb7954290 in g_free () at /usr/lib/i386-linux-gnu/libglib-2.0.so.0
 #8  0xb7938c53 in g_error_free () at /usr/lib/i386-linux-gnu/libglib-2.0.so.0
 #9  0xb66d7058 in cogl_error_free (error=0x16cba70) at cogl-error.c:45
 #10 0xb66db62c in cogl_texture_new_with_size (width=2560, height=1024, 
flags=COGL_TEXTURE_NO_SLICING, internal_format=COGL_PIXEL_FORMAT_RGBA_8888_PRE) 
at deprecated/cogl-auto-texture.c:121
         tex = 0x1da83e0
         skip_error = 0x16cba70
         ctx = <optimized out>
 #11 0xb6e9a618 in clutter_offscreen_effect_real_create_texture 
(effect=0x23c3b00, width=2560, height=1024) at clutter-offscreen-effect.c:141
 #12 0xb6e9ab6b in update_fbo (fbo_height=<optimized out>, fbo_width=<optimized 
out>, effect=0x23c3b00) at clutter-offscreen-effect.c:189
         self = 0x23c3b00
         priv = 0x23c3a30
         self = 0x23c3b00
         priv = 0x23c3a30
         box = {x1 = 3.83952416e-38, y1 = -7.05064576e-06, x2 = 
-7.46333353e-06, y2 = -6.81363736e-06}
         stage = <optimized out>
         projection = {xx = 3.83970801e-38, yx = 3.83946587e-38, zx = 
3.83939748e-38, wx = 3.83952416e-38, xy = 3.83970801e-38, yy = 3.71409562e-38, 
zy = -6.8135173e-06, wy = -3.49830611e-06, xz = -1.59032059, yz = 
3.3734514e-37, zz = 3.83939748e-38, wz = -6.83245798e-06, xw = 3.83970801e-38, 
yw = 3.83946587e-38, zw = 0, ww = -1.59032059, private_member_inv = 
{1.33061024e-37, 3.83970801e-38, -6.83241933e-06, -2.85067945e-05, 
3.83970801e-38, 3.83946587e-38, 3.83939748e-38, -2.43004561e-05, 
3.83970801e-38, 3.83946587e-38, 3.83970801e-38, -1.01604956e-35, 
2.80259693e-45, -2.02588271e-05, -3.4981374e-06, -7.46333353e-06}, 
private_member_type = 37501696, private_member_flags = 44250112, 
private_member__padding3 = 37501488}
         transparent = {private_member_red = 196 '\304', private_member_green = 
12 '\f', private_member_blue = 81 'Q', private_member_alpha = 1 '\001', 
private_member_padding0 = 22088900, private_member_padding1 = 0, 
private_member_padding2 = 1}
         stage_width = 2560
         stage_height = 1024
         fbo_width = 2560
         fbo_height = 1024
         width = -4.73312366e-06
         height = -7.46333353e-06
         xexpand = <optimized out>
         yexpand = <optimized out>
         texture_width = <optimized out>
         texture_height = <optimized out>
 #13 0xb6e9ab6b in clutter_offscreen_effect_pre_paint (effect=0x23c3b00) at 
clutter-offscreen-effect.c:267
         self = 0x23c3b00
         priv = 0x23c3a30
         box = {x1 = 3.83952416e-38, y1 = -7.05064576e-06, x2 = 
-7.46333353e-06, y2 = -6.81363736e-06}
         stage = <optimized out>
         projection = {xx = 3.83970801e-38, yx = 3.83946587e-38, zx = 
3.83939748e-38, wx = 3.83952416e-38, xy = 3.83970801e-38, yy = 3.71409562e-38, 
zy = -6.8135173e-06, wy = -3.49830611e-06, xz = -1.59032059, yz = 
3.3734514e-37, zz = 3.83939748e-38, wz = -6.83245798e-06, xw = 3.83970801e-38, 
yw = 3.83946587e-38, zw = 0, ww = -1.59032059, private_member_inv = 
{1.33061024e-37, 3.83970801e-38, -6.83241933e-06, -2.85067945e-05, 
3.83970801e-38, 3.83946587e-38, 3.83939748e-38, -2.43004561e-05, 
3.83970801e-38, 3.83946587e-38, 3.83970801e-38, -1.01604956e-35, 
2.80259693e-45, -2.02588271e-05, -3.4981374e-06, -7.46333353e-06}, 
private_member_type = 37501696, private_member_flags = 44250112, 
private_member__padding3 = 37501488}
         transparent = {private_member_red = 196 '\304', private_member_green = 
12 '\f', private_member_blue = 81 'Q', private_member_alpha = 1 '\001', 
private_member_padding0 = 22088900, private_member_padding1 = 0, 
private_member_padding2 = 1}
         stage_width = 2560
         stage_height = 1024
         fbo_width = 2560
         fbo_height = 1024
         width = -4.73312366e-06
         height = -7.46333353e-06
         xexpand = <optimized out>
         yexpand = <optimized out>
         texture_width = <optimized out>
         texture_height = <optimized out>
 #14 0xb6e8087b in clutter_effect_real_paint (effect=0x23c3b00, 
flags=CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) at clutter-effect.c:211
         actor_meta = 0x23c3b00
         actor = <optimized out>
         pre_paint_succeeded = <optimized out>

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-shell in Ubuntu.
https://bugs.launchpad.net/bugs/1790525

Title:
  gnome-shell assert failure: double free or corruption (fasttop) in
  g_free() from g_error_free() from cogl_error_free() from
  cogl_texture_new_with_size() from
  clutter_offscreen_effect_real_create_texture()

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1790525/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to