From: Brian P. <bri...@tu...> - 2004-09-27 16:20:31
|
David Reveman wrote: > I've found a pretty serious vertex buffer object bug in mesa. > > When a VBO is delete with glDeleteBuffers, VBO array pointers for vertex > arrays and similar arrays that matches the deleted VBO are reverted to > "Null Buffer Object" without incrementing the "Null Buffer Object"'s > reference count. Next time the array pointer is updated the "Null Buffer > Object"'s reference count is decremented wrongfully. The reference count > for "Null Buffer Objects" are initialized to 1000 so nothing will really > go wrong until this has been repeated a 1000 times, as the reference > count has then reached 0 and the "Null Buffer Object" is deleted. Once > that happens, you're of course in trouble. > > I guess it's a pretty big chance that nothing will happen and the > reference count variable located in deallocated memory will just > continue decrementing to negative infinity. This is probably why the bug > is a bit hard to detect. > > I've attached a simple test program that should expose the bug. If you > apply the attached assertion patch to mesa you'll get an assertion > failure at the 1000th redraw loop in the attached test program if mesa > is compiled with debugging code. > > I've put, what I think is the appropriate fix in the attached mesa-VBO- > fix.diff patch. With that one applied to mesa the test program should > run fine. I've checked in your patches. Thanks, David! -Brian |