From nobody@FreeBSD.org  Mon Mar  8 17:21:55 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92FE91065670
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Mar 2010 17:21:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 828338FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Mar 2010 17:21:55 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o28HLtSI079721
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 8 Mar 2010 17:21:55 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o28HLs8k079719;
	Mon, 8 Mar 2010 17:21:54 GMT
	(envelope-from nobody)
Message-Id: <201003081721.o28HLs8k079719@www.freebsd.org>
Date: Mon, 8 Mar 2010 17:21:54 GMT
From: Scali <scali@scali.eu.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: MesaGL glutMainLoop() crashes when using VBO extensions
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         144555
>Category:       ports
>Synopsis:       graphics/mesagl: glutMainLoop() crashes when using VBO extensions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 08 17:30:04 UTC 2010
>Closed-Date:    Thu Feb 03 10:45:51 UTC 2011
>Last-Modified:  Thu Feb 03 10:45:51 UTC 2011
>Originator:     Scali
>Release:        7.2-RELEASE AMD64
>Organization:
Bohemiq
>Environment:
FreeBSD scali.eu.org 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When using the ARB VBO extensions, leaving a buffer bound when calling glutMainLoop() or glutSwapBuffers() will result in the application crashing.
This is on an Intel G31 chipset, using the Tungsten drivers bundled with Mesa 7.4.4, built from ports.

>How-To-Repeat:
First initialize glut:
        glutInit( &argc, argv );
        glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
        glutInitWindowSize( WIDTH, HEIGHT );
        glutCreateWindow( "OpenGL Engine" );

Then create a VBO:
        glGenBuffersARB( 1, &m_nVBOVertices );
        glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOVertices );
        glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(vertices), vertices, GL_STATIC_DRAW_ARB );

Then call glutMainLoop():
        glutMainLoop(); // <-- crashes here
>Fix:
Calling glBindBufferARB( GL_ARRAY_BUFFER_ARB, 0 ); before glutMainLoop(); will avoid the crash.
However, the same problem exists with glutSwapBuffers().. it wil crash when a VBO is still bound.

This behaviour does not occur on most other OpenGL implementations, and it is common practice to not specifically unbind VBOs, when the entire application uses VBOs exclusively.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: arved 
State-Changed-When: Wed Nov 17 09:54:06 UTC 2010 
State-Changed-Why:  
To me this sounds like a bug in the upstream mesagl package. 

Did you report this bug upstream? Why do you think this is a FreeBSD 
problem? 
Do you have a patch to fix the problem? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144555 
State-Changed-From-To: feedback->closed 
State-Changed-By: arved 
State-Changed-When: Thu Feb 3 10:45:36 UTC 2011 
State-Changed-Why:  
feedback timeout, 2.5 month 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144555 
>Unformatted:
