Bug 72571 - [i965] segfault on draw call without vbo set
Summary: [i965] segfault on draw call without vbo set
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 9.2
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Tapani Pälli
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-10 17:57 UTC by Link Mauve
Modified: 2014-01-16 08:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Link Mauve 2013-12-10 17:57:17 UTC
When I call glDrawElements and one of the used vbo has no data uploaded (but is set for some attribute), I get a segfault ending there:
0xf687f487 in drm_intel_bo_reference () from /usr/lib/libdrm_intel.so.1

I didn’t have debug symbols but the glDrawElements first called into /usr/lib/libdricore9.2.4.so.1 and then into /usr/lib/xorg/modules/dri/i965_dri.so before /usr/lib/libdrm_intel.so.1

If you need any more information just ask me.
Comment 1 Link Mauve 2013-12-12 19:55:36 UTC
Here is an example program (from http://open.gl/) reproducing that issue: http://linkmauve.fr/files/mesa_testcase.cpp

To compile it:
g++ -DGL_GLEXT_PROTOTYPES -lsfml-window -lsfml-system -lGL mesa_testcase.cpp

Line 47 is commented, this was the call I forgot that made this segfault happen.

If I also comment line 46, I get this segfault instead (but with an error before):
0xf7d7c6b6 in __memcpy_ssse3_rep () from /usr/lib/libc.so.6
Comment 2 Tapani Pälli 2014-01-13 13:08:52 UTC
I've reproduced the bug with older Mesa but master appears to not crash. Will try to bisect which change has fixed this issue.
Comment 3 Link Mauve 2014-01-15 20:06:50 UTC
I confirm it is fixed in 10.0.2, same computer, same kernel.
Comment 4 Tapani Pälli 2014-01-16 07:29:21 UTC
This bug got fixed with following commit since intel_bufferobj_buffer allocates a buffer which previously did not exist yet. I've checked with valgrind and there's no problem with the use case, I will still check if we are supposed to trigger an error for this.

--------------- 8< ----------------------
commit 060a49a8966d923ad9c02d6f200baacb7ff081d4
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Oct 3 19:34:41 2013 -0700

    i965: Drop intel_bufferobj_source().
Comment 5 Tapani Pälli 2014-01-16 08:02:16 UTC
I did not find that any error should occur from GL, buffer object exists but its data is undefined in this case. I'm marking this as resolved/fixed.


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.