Debian Bug report logs - #901701
libgl1-mesa-dri: segfault in do_blit_drawpixels

version graph

Package: libgl1-mesa-dri; Maintainer for libgl1-mesa-dri is Debian X Strike Force <debian-x@lists.debian.org>; Source for libgl1-mesa-dri is src:mesa (PTS, buildd, popcon).

Affects: bumblebee

Reported by: Vincas Dargis <vindrg@gmail.com>

Date: Thu, 14 Jun 2018 18:33:02 UTC

Severity: normal

Tags: fixed-upstream

Found in version mesa/18.1.1-1

Fixed in version mesa/18.1.6-1

Done: Vincas Dargis <vindrg@gmail.com>

Bug is archived. No further changes may be made.

Forwarded to https://bugs.freedesktop.org/show_bug.cgi?id=106910

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, vindrg@gmail.com, Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>:
Bug#901563; Package bumblebee. (Thu, 14 Jun 2018 18:33:04 GMT) (full text, mbox, link).


Acknowledgement sent to Vincas Dargis <vindrg@gmail.com>:
New Bug report received and forwarded. Copy sent to vindrg@gmail.com, Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>. (Thu, 14 Jun 2018 18:33:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vincas Dargis <vindrg@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: bumblebee: using optirun introduces segfault in i965_dri.so
Date: Thu, 14 Jun 2018 21:31:50 +0300
Package: bumblebee
Version: 3.2.1-17
Severity: normal

Dear Maintainer,

Looks like after recent Mesa update in Sid, I cannot use optirun any
more on laptop with i7-4710HQ and GM107M [GeForce GTX 860M] as it
introduces crash for application run under it. 

Launching `optirun glxgears` makes glxgears crash:

```
$ sudo tail -f /var/log/kern.log -n 0
Jun 14 21:22:04 vinco kernel: [ 8317.861162] bbswitch: enabling discrete graphics
Jun 14 21:22:04 vinco kernel: [ 8318.255147] nvidia-nvlink: Nvlink Core is being initialized, major device number 243
Jun 14 21:22:04 vinco kernel: [ 8318.255469] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.59  Wed May  9 22:33:42 PDT 2018 (using threaded interrupts)
Jun 14 21:22:04 vinco kernel: [ 8318.533751] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.59  Wed May  9 21:59:27 PDT 2018
Jun 14 21:22:04 vinco kernel: [ 8318.535005] nvidia-modeset: Allocated GPU:0 (GPU-c10fe523-ec15-e66c-141e-f0e0dbf01714) @ PCI:0000:01:00.0
Jun 14 21:22:04 vinco kernel: [ 8318.535280] nvidia-modeset: Freed GPU:0 (GPU-c10fe523-ec15-e66c-141e-f0e0dbf01714) @ PCI:0000:01:00.0
Jun 14 21:22:04 vinco kernel: [ 8318.608765] nvidia-modeset: Allocated GPU:0 (GPU-c10fe523-ec15-e66c-141e-f0e0dbf01714) @ PCI:0000:01:00.0
Jun 14 21:22:04 vinco kernel: [ 8318.609032] nvidia-modeset: Freed GPU:0 (GPU-c10fe523-ec15-e66c-141e-f0e0dbf01714) @ PCI:0000:01:00.0
Jun 14 21:22:04 vinco kernel: [ 8318.660159] glxgears[10094]: segfault at 74 ip 00007f96c53ed4a7 sp 00007f96c31deb30 error 4 in i965_dri.so[7f96c4f7c000+8ab000]
Jun 14 21:22:04 vinco kernel: [ 8318.687589] nvidia-modeset: Unloading
Jun 14 21:22:04 vinco kernel: [ 8318.712623] nvidia-nvlink: Unregistered the Nvlink Core, major device number 243
Jun 14 21:22:04 vinco kernel: [ 8318.737995] bbswitch: disabling discrete graphics
Jun 14 21:22:04 vinco kernel: [ 8318.756773] pci 0000:01:00.0: Refused to change power state, currently in D0
```

Backgrace:

```
Thread 2.3 "glxgears" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee092700 (LWP 10545)]
0x00007ffff02914a7 in do_blit_drawpixels (pixels=0x0, unpack=0x7fffe0150ac8, type=5121, format=32993, height=1080, width=1920, y=0, x=0, ctx=0x7fffe0147540) at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:80
80	../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c: Toks failas ar aplankas neegzistuoja.
#0  0x00007ffff02914a7 in do_blit_drawpixels (pixels=0x0, unpack=0x7fffe0150ac8, type=5121, format=32993, height=1080, width=1920, y=0, x=0, ctx=0x7fffe0147540) at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:80
        src_offset = <optimized out>
        src_buffer = <optimized out>
        dst_format = 3761243984
        src_stride = <optimized out>
        src_flip = <optimized out>
        pbo_mt = 0x0
        rb = <optimized out>
        src_format = MESA_FORMAT_B8G8R8A8_UNORM
#1  intelDrawPixels (ctx=0x7fffe0147540, x=0, y=0, width=1920, height=1080, format=32993, type=5121, unpack=0x7fffe0150ac8, pixels=0x0) at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:167
        __func__ = "intelDrawPixels"
#2  0x00007fffefedaf33 in _mesa_DrawPixels (width=1920, height=1080, format=32993, type=5121, pixels=0x0) at ../../../src/mesa/main/drawpix.c:162
        err = <optimized out>
        ctx = 0x7fffe0147540
#3  0x00007ffff76b8345 in test_drawpixels_fast (dconfig=<optimized out>, ctx=0x7fffe00239c0, dpy=0x7fffe0000b20) at libglfork.cpp:362
        pbo = 1
        end = 8568.4529074310012
        iters = 0
        is_fast = <optimized out>
        width = 1920
        height = 1080
        pbattrs = {32833, 1920, 32832, 1080, 32795, 1, 0}
        pbuffer = 146800642
        pixeldata = <optimized out>
#4  display_work (vd=<optimized out>) at libglfork.cpp:402
        drawable = 144703490
        width = 300
        height = 300
        quad_vertex_coords = {-1, -1, -1, 1, 1, 1, 1, -1}
        quad_texture_coords = {0, 0, 0, 1, 1, 1, 1, 0}
        textures = {0, 0}
        pbos = {0, 0}
        ctex = 0
        state_names = {0x7ffff76c1244 "wait", 0x7ffff76c1249 "upload", 0x7ffff76c1250 "draw+swap", 0x0}
        profiler = {name = 0x7ffff76c1203 "display", state_names = 0x7ffff78d12e0 <display_work(void*)::state_names>, state_time = {0, 0, 0, 0, 0, 0}, prev_timestamp = 8568.2315354050006, print_timestamp = 8568.2315354050006, state = 0, nframes = 0, width = 0, height = 0}
        ddpy = 0x7fffe0000b20
        __PRETTY_FUNCTION__ = "void* display_work(void*)"
        dconfigs = 0x7fffe000fff0
        context = 0x7fffe00239c0
        use_textures = <optimized out>
#5  0x00007ffff62455aa in start_thread (arg=0x7fffee092700) at pthread_create.c:463
        pd = 0x7fffee092700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737186965248, 6747949740819525267, 140737488347470, 140737488347471, 140737488347472, 0, -6747988065853329773, -6747970307990442349}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#6  0x00007ffff6aebcbf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.
```

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8), LANGUAGE=lt (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bumblebee depends on:
ii  bbswitch-dkms      0.8-5
ii  dpkg               1.19.0.5+b1
ii  libbsd0            0.9.1-1
ii  libc6              2.27-3
ii  libglib2.0-0       2.56.1-2
ii  libkmod2           25-1
ii  libx11-6           2:1.6.5-1
ii  lsb-base           9.20170808
ii  xserver-xorg-core  2:1.20.0-2

Versions of packages bumblebee recommends:
ii  primus  0~20150328-6

Versions of packages bumblebee suggests:
ii  bumblebee-nvidia  3.2.1-17

-- no debconf information



Bug reassigned from package 'bumblebee' to 'primus-libs'. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:02 GMT) (full text, mbox, link).


No longer marked as found in versions bumblebee/3.2.1-17. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:03 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'https://github.com/amonakov/primus/issues/201'. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:04 GMT) (full text, mbox, link).


Added indication that 901563 affects bumblebee Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:04 GMT) (full text, mbox, link).


Bug 901563 cloned as bug 901701 Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:05 GMT) (full text, mbox, link).


Bug reassigned from package 'primus-libs' to 'libgl1-mesa-dri'. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:06 GMT) (full text, mbox, link).


Marked as found in versions mesa/18.1.1-1. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:06 GMT) (full text, mbox, link).


Changed Bug title to 'libgl1-mesa-dri: segfault in do_blit_drawpixels' from 'bumblebee: using optirun introduces segfault in i965_dri.so'. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Sun, 17 Jun 2018 00:33:07 GMT) (full text, mbox, link).


Changed Bug forwarded-to-address to 'https://bugs.freedesktop.org/show_bug.cgi?id=106910' from 'https://github.com/amonakov/primus/issues/201'. Request was from Daniel Serpell <daniel.serpell@gmail.com> to control@bugs.debian.org. (Wed, 20 Jun 2018 16:24:03 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#901701; Package libgl1-mesa-dri. (Sat, 30 Jun 2018 17:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Mario Palomo <mariopal@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. (Sat, 30 Jun 2018 17:15:03 GMT) (full text, mbox, link).


Message #28 received at 901701@bugs.debian.org (full text, mbox, reply):

From: Mario Palomo <mariopal@gmail.com>
To: 901701@bugs.debian.org
Subject: Re: bumblebee: using optirun introduces segfault in i965_dri.so
Date: Sat, 30 Jun 2018 19:10:51 +0200
[Message part 1 (text/plain, inline)]
On Thu, 14 Jun 2018 21:31:50 +0300 Vincas Dargis <vindrg@gmail.com> wrote:
> Package: bumblebee
> Version: 3.2.1-17
> Severity: normal
>
> Dear Maintainer,
>
> Looks like after recent Mesa update in Sid, I cannot use optirun any
> more on laptop with i7-4710HQ and GM107M [GeForce GTX 860M] as it
> introduces crash for application run under it.
>
> Launching `optirun glxgears` makes glxgears crash:
>
> [...]
>

I have read about HAVE_DRI3_MODIFIERS here:
https://bugs.freedesktop.org/show_bug.cgi?id=106910

And it works if you make the Debian package (from source mesa-18.1.2) with
the following patch (here you can get the Debian package that I have built:
http://s000.tinyupload.com/index.php?file_id=01939742983669320839):

--- a/configure.ac 2018-06-15 20:37:48.000000000 +0000
+++ b/configure.ac 2018-06-29 12:38:22.726300098 +0000
@@ -1870,9 +1870,9 @@
     dri3_modifier_modules="xcb-dri3 >= $XCBDRI3_MODIFIERS_REQUIRED
xcb-present >= $XCBPRESENT_MODIFIERS_REQUIRED"
     PKG_CHECK_MODULES([XCB_DRI3_MODIFIERS], [$dri3_modifier_modules],
[have_dri3_modifiers=yes], [have_dri3_modifiers=no])

-    if test "x$have_dri3_modifiers" == xyes; then
-        DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
-    fi
+#    if test "x$have_dri3_modifiers" == xyes; then
+#        DEFINES="$DEFINES -DHAVE_DRI3_MODIFIERS"
+#    fi
 fi

 AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#901701; Package libgl1-mesa-dri. (Sat, 07 Jul 2018 23:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vincas Dargis <vindrg@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. (Sat, 07 Jul 2018 23:36:03 GMT) (full text, mbox, link).


Message #33 received at 901701@bugs.debian.org (full text, mbox, reply):

From: Vincas Dargis <vindrg@gmail.com>
To: 901701@bugs.debian.org
Subject: Re: bumblebee: using optirun introduces segfault in i965_dri.so
Date: Sun, 8 Jul 2018 02:33:50 +0300
Looks like there is much simpler workaround:

PRIMUS_UPLOAD=1 primusrun glxgears

Works for wine too.

Thanks to Reddit user huttukuttu! [0]

[0] https://www.reddit.com/r/debian/comments/8wu8t8/bumblebee_causes_segfault_in_i965_driso/e1ywduu




Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#901701; Package libgl1-mesa-dri. (Fri, 10 Aug 2018 19:51:06 GMT) (full text, mbox, link).


Acknowledgement sent to Vincas Dargis <vindrg@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. (Fri, 10 Aug 2018 19:51:06 GMT) (full text, mbox, link).


Message #38 received at 901701@bugs.debian.org (full text, mbox, reply):

From: Vincas Dargis <vindrg@gmail.com>
To: 901701@bugs.debian.org
Subject: Re: bumblebee: using optirun introduces segfault in i965_dri.so
Date: Fri, 10 Aug 2018 22:49:34 +0300
Sadly, `PRIMUS_UPLOAD=1 primusrun glxgears` does not work any more, also segfaults:

Thread 2 "glxgears" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f3a8041c700 (LWP 12698)]
0x00007f3a8152b2ef in do_blit_drawpixels (pixels=0x0, unpack=0x7f3a78150598, type=5121, 
format=32993, height=1080, width=1920, y=0, x=0, ctx=0x7f3a78147010)
    at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:83
83      ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c: Toks failas ar aplankas 
neegzistuoja.
(gdb) bt
#0  0x00007f3a8152b2ef in do_blit_drawpixels (pixels=0x0, unpack=0x7f3a78150598, type=5121, 
format=32993, height=1080, width=1920, y=0, x=0,
    ctx=0x7f3a78147010) at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:83 

#1  intelDrawPixels (ctx=0x7f3a78147010, x=0, y=0, width=1920, height=1080, format=32993, type=5121, 
unpack=0x7f3a78150598, pixels=0x0)
    at ../../../../../../src/mesa/drivers/dri/i965/intel_pixel_draw.c:167
#2  0x00007f3a8118039c in _mesa_DrawPixels (width=1920, height=1080, format=32993, type=5121, 
pixels=0x0) at ../../../src/mesa/main/drawpix.c:162
#3  0x00007f3a86fb7345 in test_drawpixels_fast (dconfig=<optimized out>, ctx=0x7f3a78023ae0, 
dpy=0x7f3a78000b20) at libglfork.cpp:362
#4  display_work (vd=<optimized out>) at libglfork.cpp:402
#5  0x00007f3a86537f2a in start_thread (arg=0x7f3a8041c700) at pthread_create.c:463 

#6  0x00007f3a867e5edf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Applications can be launched only on integrated Intel graphics.



Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#901701; Package libgl1-mesa-dri. (Sat, 11 Aug 2018 22:03:02 GMT) (full text, mbox, link).


Acknowledgement sent to Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. (Sat, 11 Aug 2018 22:03:02 GMT) (full text, mbox, link).


Message #43 received at 901701@bugs.debian.org (full text, mbox, reply):

From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
To: 901701@bugs.debian.org
Date: Sun, 12 Aug 2018 00:01:59 +0200
This patch[1] fixes the bug for me:

diff --git a/libglfork.cpp b/libglfork.cpp
index 03f514f..dda6e4c 100644
--- a/libglfork.cpp
+++ b/libglfork.cpp
@@ -359,7 +359,7 @@ static bool test_drawpixels_fast(Display *dpy,
GLXContext ctx, GLXFBConfig dconf
   int iters = 0;
   do {
     primus.dfns.glBufferSubData(GL_PIXEL_UNPACK_BUFFER_EXT, 0,
width*height*4, pixeldata);
-    primus.dfns.glDrawPixels(width, height, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
+    primus.dfns.glDrawPixels(width, height, GL_BGRA,
GL_UNSIGNED_BYTE, pixeldata);
     primus.dfns.glXSwapBuffers(dpy, pbuffer);
     iters++;
   } while (end > Profiler::get_timestamp());

[1] https://github.com/ribalda/primus/commit/1b6dbc56040a59b6b222ba40d7c2de8c6cf1fbba

--
Ricardo Ribalda



Added tag(s) fixed-upstream. Request was from debian-bts-link@lists.debian.org to control@bugs.debian.org. (Mon, 13 Aug 2018 17:33:04 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#901701; Package libgl1-mesa-dri. (Wed, 15 Aug 2018 10:21:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vincas Dargis <vindrg@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. (Wed, 15 Aug 2018 10:21:03 GMT) (full text, mbox, link).


Message #50 received at 901701@bugs.debian.org (full text, mbox, reply):

From: Vincas Dargis <vindrg@gmail.com>
To: 901701@bugs.debian.org
Subject: Re: bumblebee: using optirun introduces segfault in i965_dri.so
Date: Wed, 15 Aug 2018 13:16:06 +0300
Control: fixed -1 18.1.6-1

It started working with 18.1.6-1 update!



Marked as fixed in versions mesa/18.1.6-1. Request was from Vincas Dargis <vindrg@gmail.com> to 901701-submit@bugs.debian.org. (Wed, 15 Aug 2018 10:21:03 GMT) (full text, mbox, link).


Reply sent to Vincas Dargis <vindrg@gmail.com>:
You have taken responsibility. (Wed, 15 Aug 2018 11:27:03 GMT) (full text, mbox, link).


Notification sent to Vincas Dargis <vindrg@gmail.com>:
Bug acknowledged by developer. (Wed, 15 Aug 2018 11:27:03 GMT) (full text, mbox, link).


Message #57 received at 901701-done@bugs.debian.org (full text, mbox, reply):

From: Vincas Dargis <vindrg@gmail.com>
To: 901701-done@bugs.debian.org
Subject: 901701-done
Date: Wed, 15 Aug 2018 14:23:58 +0300


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 16 Sep 2018 07:24:47 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Jul 2 22:25:04 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.