Bug: Any JUCE application crashes while re-sizing in case the top-level application window is attached to the OpenGL context

Hello JUCE developers,

There is a bug in the OpenGL context class. At the moment, I see it on Windows (I haven’t tested it on Linux or macOS X yet). The bug is easily reproducible in any application that attaches its top-level window to the OpenGL context. To reproduce the bug, launch any application with the re-sizable top-level window that uses the OpenGL context (e.g. DemoRunner from JUCE and make it use the OpenGL rederer). Then, grab the bottom-right corner so that to re-size the window and start reducing and enlarging the window repeatedly and very quickly for several seconds (keep the mouse button always pressed, don’t release it). You can use wide circular movements for a greater effect :slight_smile: And… the application crashes.

It crashes in the juce_OpenGL_win32.h file on:
void swapBuffers() const noexcept { SwapBuffers (dc); }

The error is: Access memory violation.

The error goes deep down to the system’s libraries and down to the OpenGL video driver. In my case this is the ‘nvoglv64.dll’.

I’m also on Windows. I could not reproduce the error. I tested the DemoRunner (set to OpenGL) and my own application that uses the OpenGLContext. Everything ran without any errors or assertions, I tried for about 2min each.

I’ve shot a short video how this happened on my computer:

Possibly, that’s NVIDIA’s video driver issue… I’m not sure.

It does look that way. The flickering is not normal as well. I have a NVIDIA GPU as well, but also an Intel iGPU so I’m not sure which exactly is doing the work at any given time.

Yeah. I’ve just tested a non-JUCE application that used OpenGL and it crashed exactly like I described. It seems the Windows/NVIDIA video driver issue.
Okay. I think the issue is a kind of ‘resolved’ :slight_smile:
Thanks! And sorry for being too loud :slight_smile: