[osg-users] Crash in nVidia driver : particles + dynamically adding/removing views

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Fri Nov 27 10:14:19 PST 2009

Hi Robert,

You latest fixes to texture and buffer objects fixed the crash I was 
experiencing in this code. Thanks!

However, starting at the second time the child window is opened (third 
time you press 'a'), I get these messages every frame, and the particle 
systems do not render correctly anymore:

Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..)

This happens on both Windows and Linux (Ubuntu Jaunty x64) So I think 
there's still something lurking. Could you check it out please? See the 
code posted in my previous message. It seems that this issue is close to 
being put to rest...

Thanks in advance,


Jean-Sébastien Guay wrote:
> Hi all,
> So I just wanted to post my latest code that can reproduce this issue, 
> and see if I can get Robert's attention so he can check it out. It may 
> be related to the crashes others are seeing with texture pools and/or 
> VBOs lately, but it might not. It's also triggered by starting/stopping 
> viewers, but it's reproducible in OSG 2.6 so it's probably not related 
> to the latest texture pool code (unless a bug has carried over from 
> before).
> The code attached can be changed using #defines at the top of the 
> osgviewer.cpp file to demonstrate the problem and two possible workarounds.
> First, you can make the program use either 
> osgParticle::PrecipitationEffect or the SiltEffect that's present it 
> osgOcean. Both will reproduce the problem and will react the same to the 
> workarounds (which makes sense since the SiltEffect is a modified 
> PrecepitationEffect to begin with). Change between the two by changing 
> the #define USE_EFFECT to either SILT or PRECIPITATION.
> Then, if you comment both the defines that follow (that start with 
> WORKAROUND_) you should be able to reproduce the bug. Run the program 
> with those two defines commented, and when the window comes up, press 
> 'a'. You'll get a new window. Press 'a' again and the window will close. 
> Repeat this. On both Linux and Windows, after 2-3 times, the window 
> becomes gray (partially or completely) and I get
> Warning: detected OpenGL error 'invalid value' at After Renderer::compile
> Additionally, under Windows, after a few more opens/closes, the app 
> crashes. On Linux it seems to crash much less often, sometimes it does, 
> but most of the time I just get the gray window.
> Now, you can test out the two workarounds by uncommenting one of the two 
> WORKAROUND_* defines. The first one is to share contexts, and the second 
> is to not reuse context IDs (by incrementing the context ID usage count 
> so that a new one is used each time). We're currently using the latter 
> workaround in our app, and it works well, but of course it would be 
> better if OSG could clean up after itself correctly when a context is 
> destroyed and then the context ID reuse would work as intended.
> So, I hope this example code helps reproduce and squash another bug... 
> Let me know if there's more I can do to help. Thanks,
> J-S

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list