I was thinking of filing this as a bug, but I wanted to try posting here first and see if there’s something I’m missing. I was working with raylib, which uses GLFW, when I started getting heap corruption errors from address sanitizer. It happened after I updated visual studio, so I’m not sure if this is an issue with MSVC or GLFW. I cloned GLFW’s current master branch, and discovered the same behavior on it (just running the example apps), ruling out raylib and my project’s code as the culprit.
Address sanitizer detects heap corruption when initializing window. This only occurs when I run an example (unmodified except to enable address sanitizer) with the screen attached to my Nvidia card. Does NOT occur when running with only the laptop screen (Intel).
Here’s a video of it, sorry about potato quality. Works on laptop display only (Intel), breaks when Nvidia gets involved.
On Windows 11, use the current version of visual studio (17.2.6), ensure you have address sanitizer installed.
glfw (master or tags/3.3.7)
examples/CmakeLists.txt, under the
if (MSVC) block add:
target_compile_options(windows PRIVATE /Zi /fsanitize=address)
or if you’re testing against tags/3.3.7
target_compile_options(simple PRIVATE /Zi /fsanitize=address)
windows (master) or
simple (tags/3.3.7) and run.
Visual Studio 17.2.6
Nvidia driver 516.59
Intel driver 101.1994
(Note I used Display Driver Uninstaller to remove all my display drivers and install latest versions fresh, problem persisted)
Windows 11 - 21H2 - build 22000.795