OK, so I implemented the pipeline objects using a shared uniform block…
But now I get a segmentation fault!
It is triggered when I use glUseProgramStages, but the segmentation fault occurs when the program is exiting inside the NVIDIA OpenGL implementation as it’s shared libary gets unloaded.
I have done some tests:
I tried adding #extension ARB_separate_shader_objects : enable to my shaders but it did not change anything.
Reading through the NVIDIA read me under “Chapter 9. Known Issues”, heading “libGL DSO finalizer and pthreads” it talks about issues with multithread OpenGL (which I do not do) and mentions the environment variable “__GL_NO_DSO_FINALIZER”. If I set this variable to “1” the issue goes away, which confirms that it is some sort of bug in NVIDIA’s resource freeing code.
I figured out what was causing problems with my color uniform: I was using glUniform instead of the new glProgramUniform.
The crash remains though, but everything works until I exit the program which is OK for now considering I can disable the crash with the mentioned environment variable.
Yeah I did give them source code, shaders, crash logs, coredump of the crash etc.
In March I got this reply:
“Thanks for reporting this. The problem has been identified and fixed; however, the fix will not make it into the 270.xx driver series, but the next series after that. In the meantime, please continue to use __GL_NO_DSO_FINALIZER as a workaround.”
I had assumed at the time it would be fixed in the 275 series and have not had a chance to check it since. Having look through the changelogs for 270 through 290 I see no mention of this bug yet plenty of other bugs were fixed.
If they have already got a patch to fix the bug why have they not merged it into their public drivers?
After talking with NVIDIA it turned out to be a bug in my code… I memcpy’d past the end of a mapped vertex buffer.
Sorry to NVIDIA for making it look like they didn’t fix it. However it would be nice to get more feedback from OpenGL for these sorts of easy to make mistakes.
I suggested to the NVIDIA developer adding a check for buffer overflows with the glMapBuffer calls when a debug context is enabled. The driver could then report the problem via GL_ARB_debug_output.