Bug 76400 - [HSW] Segmentation Fault in Simple OpenGL 3.3 Application
Summary: [HSW] Segmentation Fault in Simple OpenGL 3.3 Application
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 10.1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Kenneth Graunke
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-20 12:17 UTC by Philipp Stiegernigg
Modified: 2014-04-08 07:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
TwoTriangles_Shader (3.23 KB, text/plain)
2014-03-20 12:17 UTC, Philipp Stiegernigg
Details
apitrace trace --api gl ./TwoTriangles_Shader (48.14 KB, application/octet-stream)
2014-03-20 12:18 UTC, Philipp Stiegernigg
Details

Description Philipp Stiegernigg 2014-03-20 12:17:06 UTC
Created attachment 96099 [details]
TwoTriangles_Shader
Comment 1 Philipp Stiegernigg 2014-03-20 12:18:24 UTC
Created attachment 96100 [details]
apitrace trace --api gl ./TwoTriangles_Shader
Comment 2 Philipp Stiegernigg 2014-03-20 12:28:25 UTC
An simple shader based OpenGL 3.3 example (See attachment) crashes with a segmentation fault in intel-dri. Works perfectly on another machine wih Nvidia
proprietary driver. 

CPU: Intel Core i7 4500U Haswell
Mesa: 10.1.0
Intel Video Driver: xf86-video-intel 2.99.910
OS: Arch Linux
Linux Kernel: 3.13.6-1-ARCH
Comment 3 Kenneth Graunke 2014-03-20 18:58:08 UTC
I've posted a fix for the crash to the mailing list:
http://lists.freedesktop.org/archives/mesa-dev/2014-March/056286.html

However, this won't fix your application.  It's trying to use the default vertex array object (VAO); core profile requires you to create and bind your own.

Because of this, you're getting an GL_INVALID_OPERATION from glVertexAttribPointer, and your vertex data is never getting specified.  This is easily seen when replaying the apitrace:

0 371 glVertexAttribPointer(index = 0, size = 3, type = GL_FLOAT, normalized = GL_FALSE, stride = 24, pointer = NULL)
371: warning: glGetError(glVertexAttribPointer) = GL_INVALID_OPERATION
Comment 4 Kenneth Graunke 2014-04-08 07:05:45 UTC
Crash fixed in master by:

commit 1afe3359258a9e89b62c8638761f52d78f6d1cbc
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Mar 20 11:53:16 2014 -0700

    mesa: In core profile, refuse to draw unless a VAO is bound.
    
    Core profile requires a non-default VAO to be bound.  Currently, calls
    to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
    and we never actually get any vertex data set.  Trying to draw without
    any vertex data can only cause problems.  In i965, it causes a crash.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Cc: mesa-stable@lists.freedesktop.org

You'll still need to bind a non-default VAO in order for the application to work.


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.