Jump to content
  • Advertisement
Sign in to follow this  
Schematic

OpenGL System Crashes w/ any attempt at complexity

This topic is 5063 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My problem: The system suffers a total crash, complete with blank screen and the need to hit the reset button. The Cause: As far as I can tell, it only occurs if I have a critical number of writes to OpenGL (ie glBegin/glEnd), though that's only my best guess right now. I have no idea what the critical level is, though (still inching my way towards it). Here's what it does, best as I can describe it: GL is opened in windowed mode (not doing fullscreen yet, for easier debugging). If all goes well, there is a slight pause before the window shows up and then everything shows in it's full glory (or lack thereof). If it crashes, though, it crashes after the same pause, but instead of a window popping up, the entire screen goes dead (like it's video has been lost). Does anyone have any ideas on what I may be doing wrong? When I say complex, I'm only talking a few hundred polygons total.

Share this post


Link to post
Share on other sites
Advertisement
It checks for errors at general init... but I'm not sure how to poll for errors in general (like say I push it one polygon over the line, etc).

I've tried to get it to crash gracefully in the event of a problem, but the system goes down completely, making it hard to troubleshoot the issue.

Do you have a specific way you'd check for errors, something that might let me catch the error before it goes too far?

Share this post


Link to post
Share on other sites
to check for opengl errors use glError() after each gl call. However, unless you do have a bad driver or something, this doesn't really sound like a ogl error to me. Check the driver first. Do you have problems with other opengl apps or games? Try updating and replacing your driver. Once you have that eleminated as a possibility you'll need to move on to standard debugging approaches.

First you need to try to get the bug to be reproduciable. Then you have a few choices. You can step through your code with a debugger; try to find the place in the code where the crash occurs. Another option is to comment out chunks of your code. Remove big chunks until the bug doesn't occur, then add back in smaller ones until it retures, continue until you've narrowed down the problem. A third option is to log information as the program runs and look for unexpected behavior.

Try posting here again with some source code. If you can narrow the problem down a bit first you can just post the code that seems to be related.

Share this post


Link to post
Share on other sites
The source code beyond the gl initialization is pretty extensive, but what I'll do is write a version that builds up what it's drawing, until it either sees something in glError() or until the system dies. If that doesn't work, I'll try stripping it down (again) to the bare minimum needed to duplicate the issue.

I don't believe it's a non-gl error because when I turn off the actual writes to gl, it doesn't crash. They're reproducable, but it's hard to home in on the exact cause because of the hassle involved in rebooting (and often in having to pull the code from a backup made just before execution, since my source often ends up corrupted). Up till now I've just stuck with simple displays and backed off from anything that caused a crash (and now I guess it's time to fix the problem good and proper).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!