<p>I'm using the VBO extension for storing Vertex, normal and color buffers (glBindBufferARB)
For some reason when changing buffers or doing some operation the application crashes with an access violation. When attaching The debugger I see that the crash is in some thread that is not my main thread which performs the opengl call with the execution in some dll which is related to the nvidia graphics driver.</p>

<p>What probably happened is that I gave some buffer call a bad buffer or with a wrong size. So my question is, how do I debug this situation? The crash seem to happen some time after the actual call and in a different thread.</p>

[{'answer_id': 66027, 'author': 'Baxissimo', 'author_id': 9631, 'author_profile': 'https://Stackoverflow.com/users/9631', 'pm_score': 0, 'selected': False, 'text': "<p>I think you may just have to brute force that one.\nI.e. comment out any vbo using lines a few at a time till your program doesn't crash anymore.  Then you'll have an idea of which lines to focus your attention on and really scrutinize the parameters you're passing.</p>\n\n<p>Also try sprinkling glError() calls liberally around your program.  Often if you pass a bogus parameter glError will tell you something is wrong before it gets to the point of crashing.</p>\n"}, {'answer_id': 66038, 'author': 'Torlack', 'author_id': 5243, 'author_profile': 'https://Stackoverflow.com/users/5243', 'pm_score': -1, 'selected': False, 'text': "<p>One of the best OpenGl/D3D debugging tools is nVidia's NvPerfHUD.  It won't help you find your exact problem, but it does provide another view of what you are sending into the rendering pipeline.</p>\n\n<p>However, I will say that I've only used it with D3D applications so I don't know if it helps as much with OpenGL programs. </p>\n\n<p>EDIT:</p>\n\n<p>I'm not sure why this got voted down.  I have debugged VB and IB problems with NvPerfHUD before.  Simple things such as bad primitive counts and be diagnosed by looking at each individual draw call.</p>\n"}, {'answer_id': 74253, 'author': 'NeARAZ', 'author_id': 6799, 'author_profile': 'https://Stackoverflow.com/users/6799', 'pm_score': 2, 'selected': False, 'text': '<p>Assuming this is about Windows, NVIDIA has a <a href="http://developer.nvidia.com/object/glexpert_home.html" rel="nofollow noreferrer">GLExpert</a> tool. It can print various OpenGL warnings/errors.</p>\n\n<p>In some other cases, using <a href="http://glintercept.nutty.org/" rel="nofollow noreferrer">GLIntercept</a> OpenGL call interceptor with error checking turned on can be useful.</p>\n\n<p>If the tools do not help, well, then it\'s good old debugging. Try to narrow down the problem and locate what exactly causes a crash. If it\'s a NVIDIA specific problem, try installing different drivers and/or asking on NVIDIA developer forums.</p>\n'}]
['https://Stackoverflow.com/questions/65910', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9611/']