Summary: | Segfault when calling glViewport on surfaceless EGL context without bound FBO | ||
---|---|---|---|
Product: | Mesa | Reporter: | Martina Kollarova <martina.kollarova> |
Component: | EGL | Assignee: | mesa-dev |
Status: | RESOLVED DUPLICATE | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | philip+freedesktop, tworaz666 |
Version: | git | ||
Hardware: | Other | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
glxinfo
output on both Linux and ChromeOS |
Description
Martina Kollarova
2015-06-02 14:51:24 UTC
Reproducer: https://github.com/mkollaro/opengl_snippets/blob/master/egl/main.cpp Compile with: gcc main.cpp -std=c++11 -lEGL -lGLESv2 It will segfault if the bug is present, print "Success" on the last line if not. Reproduced on Linux Mint 17.1 Rebecca (based on Ubuntu Trusty) with Mesa 10.7.0-devel and Ubuntu 15.04 with Mesa 10.5.2. Could not reproduce on ChromeOS with Mesa 10.3r33. The Yocto setup is currently unavailable. You can additionally add "-DNO_SURFACE=false" and it will use a pbuffer surface, where the segfault doesn't occur. Created attachment 116287 [details]
output on both Linux and ChromeOS
Correction: The ChromeOS setup (where the bug doesn't reproduce) didn't use Mesa 10.3r33, but 10.5.0-devel.
Indeed, I can reproduce on master using your test program (thanks a lot for that!) Program received signal SIGSEGV, Segmentation fault. 0x00007ffff4e1ad42 in dri2InvalidateDrawable (drawable=0x0) at ../../../../../../mesa/src/mesa/drivers/dri/common/dri_util.c:798 798 drawable->dri2.stamp++; (gdb) bt #0 0x00007ffff4e1ad42 in dri2InvalidateDrawable (drawable=0x0) at ../../../../../../mesa/src/mesa/drivers/dri/common/dri_util.c:798 #1 0x00007ffff4e382b5 in intel_viewport (ctx=0x7ffff7fcf040) at ../../../../../../mesa/src/mesa/drivers/dri/i965/brw_context.c:155 #2 0x00007ffff4b9f405 in _mesa_Viewport (x=0, y=0, width=0, height=0) at ../../../mesa/src/mesa/main/viewport.c:125 #3 0x00000000004014f4 in main (argc=1, argv=0x7fffffffe148) at main.cpp:180 I encountered this too, on i965. It happens because intel_viewport calls _mesa_is_winsys_fbo to determine whether the draw buffer has an associated DRI2 drawable, but that predicate returns true for the global IncompleteFramebuffer which is used by surfaceless contexts, which obviously has no DRI2 drawable. A null pointer check in intel_viewport fixes it. The i915 driver looks like it has the same problem (in intel_invalidate_viewport), though I haven't tested it. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.