[Bug 107782] SIGSEGV in intelCreateBuffer(intel_screen.c) when using EGL_KHR_gl_colorspace

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Sep 2 15:07:47 UTC 2018


            Bug ID: 107782
           Summary: SIGSEGV in intelCreateBuffer(intel_screen.c) when
                    using EGL_KHR_gl_colorspace
           Product: Mesa
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/DRI/i965
          Assignee: intel-3d-bugs at lists.freedesktop.org
          Reporter: elias.naur at gmail.com
        QA Contact: intel-3d-bugs at lists.freedesktop.org

Created attachment 141413
  --> https://bugs.freedesktop.org/attachment.cgi?id=141413&action=edit
test program

I'm running the attached example on Ubuntu 18.04.01 where I'm trying to create
an OpenGL ES 3 context with EGL where the framebuffer supports sRGB. When using
the EGL_KHR_gl_colorspace extension attributes for eglCreateWindowSurface, the
call crashes.

Compiled with:

gcc -o test init_window.c -I. -lwayland-client -lwayland-server -lwayland-egl
-lEGL -lGLESv2

The gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
intelCreateBuffer (dri_screen=0x5555557873e0, driDrawPriv=0x5555558a2950,
mesaVis=0x0, isPixmap=0 '\000')
    at ../../../../../../src/mesa/drivers/dri/i965/intel_screen.c:1615
1615    ../../../../../../src/mesa/drivers/dri/i965/intel_screen.c: No such
file or directory.
=> 0x00007ffff367babb <intelCreateBuffer+27>:   8b 72 78        mov   
   0x00007ffff367babe <intelCreateBuffer+30>:   48 89 ef        mov   
   0x00007ffff367bac1 <intelCreateBuffer+33>:   e8 aa 83 ff ff  callq 
0x7ffff3673e70 <intel_quantize_num_samples>
(gdb) bt
#0  intelCreateBuffer (dri_screen=0x5555557873e0, driDrawPriv=0x5555558a2950,
mesaVis=0x0, isPixmap=0 '\000')
    at ../../../../../../src/mesa/drivers/dri/i965/intel_screen.c:1615
#1  0x00007ffff3611957 in driCreateNewDrawable (screen=0x5555557873e0,
config=0x0, data=0x5555558a5ce0)
    at ../../../../../../src/mesa/drivers/dri/common/dri_util.c:695
#2  0x00007ffff64a9c27 in ?? () from /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0
#3  0x00007ffff6496aa7 in ?? () from /usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0
#4  0x00005555555557c0 in CreateEGLContext ()
#5  0x0000555555555931 in CreateWindowWithEGLContext ()
#6  0x0000555555555c27 in main ()

and the top of the disassembly:

(gdb) disas
Dump of assembler code for function intelCreateBuffer:
   0x00007ffff367baa0 <+0>:     push   %r15
   0x00007ffff367baa2 <+2>:     push   %r14
   0x00007ffff367baa4 <+4>:     push   %r13
   0x00007ffff367baa6 <+6>:     push   %r12
   0x00007ffff367baa8 <+8>:     mov    %rsi,%r13
   0x00007ffff367baab <+11>:    push   %rbp
   0x00007ffff367baac <+12>:    push   %rbx
   0x00007ffff367baad <+13>:    mov    %ecx,%r12d
   0x00007ffff367bab0 <+16>:    mov    %rdx,%rbx
   0x00007ffff367bab3 <+19>:    sub    $0x18,%rsp
   0x00007ffff367bab7 <+23>:    mov    0x10(%rdi),%rbp
=> 0x00007ffff367babb <+27>:    mov    0x78(%rdx),%esi
   0x00007ffff367babe <+30>:    mov    %rbp,%rdi
   0x00007ffff367bac1 <+33>:    callq  0x7ffff3673e70

The offending code is:

   EGLint surfaceAttribs[] = { EGL_GL_COLORSPACE_KHR,
   // Create a surface
   surface = eglCreateWindowSurface(display, config, ESContext.native_window,

window is displayed with a clear color and no crashes.

My system details (a Lenovo X1 Carbon 1st gen.):

$ uname -a
Linux elias-x1 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018
x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

The list of extensions as reported by eglGetString(EGL_EXTENSIONS). Note that
EGL_KHR_gl_colorspace is included:

EGL_ANDROID_native_fence_sync EGL_CHROMIUM_sync_control EGL_EXT_buffer_age
EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import
EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_config_attribs
EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync
EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image
EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context
EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float
EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image
EGL_MESA_image_dma_buf_export EGL_NOK_texture_from_pixmap

The reported EGL version is 1.4.

The display section from lshw:

             description: VGA compatible controller
             product: 3rd Gen Core processor Graphics Controller
             vendor: Intel Corporation
             physical id: 2
             bus info: pci at 0000:00:02.0
             version: 09
             width: 64 bits
             clock: 33MHz
             capabilities: vga_controller bus_master cap_list rom
             configuration: driver=i915 latency=0
             resources: irq:28 memory:f0000000-f03fffff
memory:e0000000-efffffff ioport:5000(size=64) memory:c0000-dffff

I would expect that

(1) An error from eglCreateWindowSurface, not a crash
(2) The EGL_KHR_gl_colorspace extension not be included in EGL_EXTENSIONS if it
can't be supported.

and, if possible,

(3) Support for OpenGL surfaces with a sRGB framebuffer created through EGL on
Wayland. Note that the hardware reports GLX_ARB_framebuffer_sRGB for GLX.

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20180902/6b709496/attachment.html>

More information about the intel-3d-bugs mailing list