Bug 23489

Summary: empty glBegin/glEnd clauses crash
Product: Mesa Reporter: Tormod Volden <bugzi11.fdo.tormod>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: sobkas
Version: unspecified   
Hardware: Other   
OS: All   
URL: https://bugs.launchpad.net/bugs/346072
Whiteboard:
i915 platform: i915 features:
Attachments: test case

Description Tormod Volden 2009-08-24 11:26:27 UTC
Created attachment 28886 [details]
test case

If for instance,
       glBegin(GL_LINES);
       glEnd();
is repeated (64 times here) mesa will crash with

Program received signal SIGFPE, Arithmetic exception.
0x0109d5a0 in vbo_exec_vtx_flush (exec=0x809fc98, unmap=0 '\0')

because exec->vtx.vertex_size = 0 and we get a division by zero. Not that this is a useful construct, but it happens in some programs and did not crash before. http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/begin.html says "Lines, triangles,	quadrilaterals,	and polygons that	are incompletely specified are not drawn."

The attached test program demonstrates the crash (it is based on the example in http://glprogramming.com/red/chapter01.html :) )
Comment 1 Brian Paul 2009-08-24 11:45:13 UTC
Fixed with commit b9b04872d526ed7955f647542399e110ace0325c.
This'll be in Mesa 7.5.1 and later.
Comment 2 Tormod Volden 2009-08-25 00:47:57 UTC
*** Bug 20850 has been marked as a duplicate of this bug. ***

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.