Login  Register

I had a fun one today.

Posted by imakerobots on Mar 25, 2025; 3:43pm
URL: https://forum.jogamp.org/I-had-a-fun-one-today-tp4043704.html

For reasons I won't go into, I had to make a Graphics2D wrapper for GL2.  the wrapper dispose() calls gl2.glEnd().
I manually call dispose() because I clean up after myself.  Ran fine here, passed all tests.

Two days after release a client says it crashes within seconds of startup.  No log incident generated, even when I threw an exception in dispose().  Eventually we got a FATAL EXCEPTION on the command line.  Turns out the garbage cleaner is calling finalize() which calls glEnd() which then dies because something inside gl2 is probably null?  points to 0x00000000.

I can't reproduce it in a test case but I thought I'd share it anyhow.  Maybe there's a way to test calling glEnd() twice to see if it warns, exceptions, or dies in the native driver.

hs_err_pid5072.log