Bug 40308 - glGenerateMipmap causes segmentation fault
Summary: glGenerateMipmap causes segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i915 (show other bugs)
Version: 7.10
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 05:49 UTC by tero.pihlajakoski
Modified: 2011-10-20 10:58 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Source code to reproduce bug (4.07 KB, application/x-gzip)
2011-08-23 05:49 UTC, tero.pihlajakoski
Details

Description tero.pihlajakoski 2011-08-23 05:49:06 UTC
Created attachment 50487 [details]
Source code to reproduce bug

If glGenerateMipmap is called on i915 driver, a segmentation fault is signaled.

Attached is a test file derived from opengles2 demo `tri.c'. It can be run with `gcc -lGLESv2 -lEGL -lm ./crash.h && ./a.out' provided the i915 EGL and GLES 2 drivers have been installed.

The important line is #499. Removing it will prevent the segmentation fault from happening. There are no textures generated, but calling the function in question should not cause a segmentation fault.

Note that the defect occurs on Mesa 7.11 also.
Comment 1 Eric Anholt 2011-10-04 13:05:00 UTC
Oh, if glGenerateMipmap() is called on a texture object with no teximage to generate from at all.  Funny.  I'll make a piglit test for it.
Comment 2 Eric Anholt 2011-10-20 10:58:21 UTC
I accidentally squashed the fix into this unrelated commit:

commit f80e1e7d1de80fd919f376368d1cfc9416dabdc3
Author: Eric Anholt <eric@anholt.net>
Date:   Tue Oct 18 11:52:39 2011 -0700

    mesa: Round the argument to PixelStoref instead of truncating.

Thanks for the bug report with testcase!


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.