Bug 39645 - Mesa crashes when trying to run an OpenGL ES 2 app
Summary: Mesa crashes when trying to run an OpenGL ES 2 app
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
: 39649 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-28 10:18 UTC by Bartosz Brachaczek
Modified: 2011-07-29 10:09 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
GDB backtrace (2.65 KB, text/plain)
2011-07-28 10:18 UTC, Bartosz Brachaczek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartosz Brachaczek 2011-07-28 10:18:48 UTC
Created attachment 49679 [details]
GDB backtrace

Mesa crashes for me always with the same backtrace when I try to run a gles app. Tested with KWin 4.7.0 and glmark2-es2. I'm using an Intel Sandy Bridge GPU.
Software:
- Linux kernel 3.0.0
- Mesa 7.12-devel (git-0aed27e), using dri/i965
- xf86-video-intel git master 1b9e82b, no SNA
- libdrm git master ce317a6

Attaching a backtrace.
Comment 1 Chad Versace 2011-07-28 13:01:13 UTC
The backtrace shows that you are using gbm. Did you intentionally configure Mesa with --enable-gbm? Please post the options you passed to autoconf.

I am unsure if i965 currently supports gbm, so I'm CC'ing gbm's author, benjaminfranzke@googlemail.com.
Comment 2 Bartosz Brachaczek 2011-07-28 13:19:25 UTC
I am compiling Mesa through Gentoo Portage that automates the process. But I don't see anything looking like enabling gbm in its scripts. Here are the options:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-option-checking --with-driver=dri --disable-glut --without-demos --enable-xcb --enable-debug --disable-g3dvl --disable-glw --disable-motif --enable-glx-tls --enable-asm --enable-shared-dricore --enable-shared-glapi --disable-vdpau --disable-xvmc --with-dri-drivers=,swrast,i965 --with-gallium-drivers= --enable-texture-float --enable-gles1 --enable-gles2 --enable-egl --disable-openvg --with-egl-platforms=drm,x11 --disable-gallium-egl
Comment 3 Tobias Droste 2011-07-28 16:12:47 UTC
*** Bug 39649 has been marked as a duplicate of this bug. ***
Comment 4 Nikos Chantziaras 2011-07-28 16:28:06 UTC
Same problem here. Here's my configure options along with the output from it:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-option-checking --with-driver=dri --disable-glut --without-demos --enable-xcb --disable-debug --enable-g3dvl --disable-glw --disable-motif --enable-glx-tls --enable-asm --disable-shared-dricore --enable-shared-glapi --enable-vdpau --enable-xvmc --with-dri-drivers=,swrast,r600 --with-gallium-drivers=,swrast,r600 --enable-texture-float --enable-gles1 --enable-gles2 --enable-egl --disable-openvg --with-egl-platforms=drm,x11 --enable-gallium-egl --with-state-trackers=glx,dri,egl --enable-gallium-llvm
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... x86_64-pc-linux-gnu-gcc -E
checking for x86_64-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether x86_64-pc-linux-gnu-gcc accepts -g... (cached) yes
checking for x86_64-pc-linux-gnu-gcc option to accept ISO C89... (cached) none needed
checking for x86_64-pc-linux-gnu-g++... x86_64-pc-linux-gnu-g++
checking whether we are using the GNU C++ compiler... yes
checking whether x86_64-pc-linux-gnu-g++ accepts -g... yes
checking for gmake... gmake
checking for python2... python2
checking for makedepend... /usr/bin/makedepend
checking for sed... /bin/sed
checking for flex... /usr/bin/flex
checking for bison... /usr/bin/bison
checking for a BSD-compatible install... /usr/bin/install -c
checking if compiling with clang... no
checking whether gcc version is sufficient... yes
checking for x86_64-pc-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether x86_64-pc-linux-gnu-gcc supports -fvisibility=hidden... yes
checking whether x86_64-pc-linux-gnu-g++ supports -fvisibility=hidden... yes
configure: WARNING: Floating-point textures enabled.
configure: WARNING: Please consult docs/patents.txt with your lawyer before building Mesa.
checking whether to enable assembly... yes, x86_64
checking for x86_64-pc-linux-gnu-gcc option to produce PIC... -fPIC
checking for dlopen... no
checking for dlopen in -ldl... yes
checking for posix_memalign... yes
checking for LIBDRM... yes
checking pkg-config files for X11 are available... yes
checking for X11... yes
checking for GLPROTO... yes
checking for DRI2PROTO... yes
checking for XF86VIDMODE... yes
checking for DRIGL... yes
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for XML_ParserCreate in -lexpat... yes
checking for LIBDRM_RADEON... yes
checking for LIBUDEV... yes
checking for LIBUDEV... yes
checking for XCB_DRI2... yes
checking for xcb_dri2_connect_alignment_pad in -lxcb-dri2... no
checking for XVMC... yes
checking for VDPAU... yes
checking for llvm-config... /usr/bin/llvm-config
configure: creating ./config.status
config.status: creating configs/autoconf
config.status: executing configs commands

        prefix:          /usr
        exec_prefix:     ${prefix}
        libdir:          /usr/lib64
        includedir:      ${prefix}/include

        OpenGL:          yes (ES1: yes ES2: yes)
        OpenVG:          no

        OSMesa:          no
        DRI drivers:     swrast r600
        DRI driver dir:  ${libdir}/dri
        Shared dricore:  no
        GLX:             DRI-based
        Use XCB:         yes

        GLU:             yes
        GLw:             no (Motif: no)

        EGL:             yes
        EGL platforms:   drm x11
        EGL drivers:     builtin:egl_glx builtin:egl_dri2 egl_gallium
        EGL Gallium STs: $(GL_LIB)

        llvm:            yes
        llvm-config:     /usr/bin/llvm-config
        llvm-version:    2.9

        Gallium:         yes
        Gallium dirs:    auxiliary drivers state_trackers
        Target dirs:     dri-r600 dri-swrast egl-static gbm vdpau-r600 vdpau-softpipe xvmc-r600 xvmc-softpipe 
        Winsys dirs:     g3dvl/dri r600/drm sw sw/dri sw/xlib 
        Driver dirs:     failover galahad identity llvmpipe noop r600 rbug softpipe trace 
        Trackers dirs:   dri egl gbm vdpau xorg/xvmc 

        Shared libs:     yes
        Static libs:     no

        CFLAGS:          -pipe -mssse3 -mtune=native -march=native -O2 -g -ffast-math -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -pipe -mssse3 -mtune=native -march=native -O2 -g -ffast-math -fPIC
        CXXFLAGS:        -pipe -mssse3 -mtune=native -march=native -O2 -g -ffast-math -Wall -fno-strict-aliasing -pipe -mssse3 -mtune=native -march=native -O2 -g -ffast-math -fPIC
        Macros:          -D_GNU_SOURCE -DPTHREADS -DTEXTURE_FLOAT_ENABLED -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DHAVE_LIBUDEV -DHAVE_XCB_DRI2 -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN -D__STDC_CONSTANT_MACROS -DUSE_X86_64_ASM

        PYTHON2:         python2

        Run 'gmake' to build Mesa
Comment 5 Alex Deucher 2011-07-28 17:00:09 UTC
You may be using the classic driver.  Try removing --with-dri-drivers=,swrast,r600 from your configure list to build only the gallium driver.
Comment 6 Nikos Chantziaras 2011-07-28 17:04:14 UTC
(In reply to comment #5)
> You may be using the classic driver.  Try removing
> --with-dri-drivers=,swrast,r600 from your configure list to build only the
> gallium driver.

glxinfo | grep renderer
OpenGL renderer string: Gallium 0.4 on AMD RV770
Comment 7 Tobias Droste 2011-07-28 17:54:45 UTC
The bug only occurs with drm platform. With x11 everything should work fine. 
A workaround would be
a) Setting EGL_PLATFORM=x11
b) Don't build drm platform, so that x11 is chosen by default. (--with-egl-platforms=x11 instead of --with-egl-platforms=drm,x11)
Comment 8 Nikos Chantziaras 2011-07-28 18:18:01 UTC
(In reply to comment #7)
> The bug only occurs with drm platform. With x11 everything should work fine. 
> A workaround would be
> a) Setting EGL_PLATFORM=x11
> b) Don't build drm platform, so that x11 is chosen by default.
> (--with-egl-platforms=x11 instead of --with-egl-platforms=drm,x11)

EGL_PLATFORM=x11 gets rid of the crash.

Is is just me, or does this result in slow performance? Everything seems more sluggish now, even though KWin with GLES is supposed to be faster than with normal GL.
Comment 9 Benjamin Franzke 2011-07-29 00:35:53 UTC
As mentioned before, this is a configuration problem.

Currently we cannot automatically decide which egl backend should be used from of a EGLNativeDisplay (this is abit broken in egl), so we have to default to sth.
We use the first entry in --with-egl-platforms=, or EGL_PLATFORM environment variable, to decide which backend to use.

Today everyone will want x11 as the default, so use --with-egl-platforms=x11,drm instead (where drm is only really useful for wayland anyway).

To answer some questions:
 - gbm is autoenabled when drm egl platform is choosen
 - i965 works with gbm, when an gbm_device is used as EGLNativeDisplay
   (not an x11 Display like here)

Closing since this is not really a bug.
Comment 10 Ian Romanick 2011-07-29 10:09:10 UTC
(In reply to comment #9)
> As mentioned before, this is a configuration problem.
> 
> Currently we cannot automatically decide which egl backend should be used from
> of a EGLNativeDisplay (this is abit broken in egl), so we have to default to
> sth.
> We use the first entry in --with-egl-platforms=, or EGL_PLATFORM environment
> variable, to decide which backend to use.

Would it be possible to key the choice on existing environment variables?  I thought Wayland had something that was the moral equivalent of X's DISPLAY.  If DISPLAY is set, but the Wayland variable is not, then the EGL platform choice should default to X.  Just a thought...

If something isn't done, we'll have to continue spending time fielding these bug reports.  That doesn't sound like a good use of anyone's time.


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.