Access violation in nvoglv32.dll - how do I track down the problem?

Every 10 times or so, when I run our game, it crashes on a draw call after we load our textures and start trying to load the normal game screen. (Rendering the initial loading screen doesn’t crash)

The actual error is:
First-chance exception at 0x69CCA3E0 (nvoglv32.dll) in nightmareDebug.exe: 0xC0000005: Access violation reading location 0x007C0008.

It is crashing on a call to glDrawArrays. We are not using any sort of buffers for this particular call - just a standard glVertexAttribPointer. We do a glGetError with pretty much every operation, and it’s not detecting any errors. I’m a bit stumped as to what could be going wrong. I looked at the verts that it is trying to draw, and they seem fine.

Any idea what the problem might be or how I should go about fixing this error?

Thanks!

OpenGL has nothing to do with CUDA GPU accelerated libraries so I am not sure what kind of help you expect to get here.

Have you tried using OpenGL debug output?

// forward declaration
void __stdcall OpenGLDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);

// function pointer
PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback = nullptr;

// in your OpenGL init
glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)wglGetProcAddress("glDebugMessageCallback");

if (glDebugMessageCallback != nullptr) {
	glDebugMessageCallback(OpenGLDebugCallback, nullptr);
	glEnable(GL_DEBUG_OUTPUT);
	glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
}

// use this to log OpenGL debug messages or send them to debug output like below
void __stdcall OpenGLDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
{
	OutputDebugStringA("\n");
	OutputDebugStringA(message);
	OutputDebugStringA("\n");
}