Crash Closing A Deferred Viewport
Describe the bug When using a deferred viewport on Windows with 0.28 or later, I see access violations when you use the window close button.
This replicates with the multiple viewports example on master.
To Reproduce
- Run the multiple viewports example with
cargo run -p multiple_viewports. - Tick
Show Deferred Viewport. - Click the close window button on the new window.
- You should see an access violation.
Desktop (please complete the following information):
- OS: Windows 11
- Rust Version: 1.79 on x86_64-pc-windows-msvc
- Egui/Eframe 0.28 and higher seems to replicate
I'm hoping to have time to dig a little deeper myself, but I wanted to record it here in case anyone else has seen it.
Attempted a git bisect which seems to point to 21835c31760f0c3e03d0d3db1f44b00ecb955734 as the problem commit.
Also run in windbg and this is the call stack - not sure if it is much use though but I guess it points to openGL? I'm probably out of my depth after this!
Debug output:
(b0c4.7db8): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
igxelpicd64!DrvPresentBuffers+0x36:
00007ff8`c51d8b16 488b5008 mov rdx,qword ptr [rax+8] ds:00000000`00000008=????????????????
0:010> p
(b0c4.7db8): Access violation - code c0000005 (!!! second chance !!!)
igxelpicd64!DrvPresentBuffers+0x36:
00007ff8`c51d8b16 488b5008 mov rdx,qword ptr [rax+8] ds:00000000`00000008=????????????????
OS: Windows 10 egui: Master Version
According to the above conditions, there is no problem.
I'm still seeing this on the latest master, perhaps it is Windows 11 specific?
I hit the same issue on windows 11 and egui master with the multiple_viewports example and 1.88.0-x86_64-pc-windows-msvc as well as latest nightly
1.90-x86_64-pc-windows-msvc
rustc 1.90.0 (1159e78c4 2025-09-14)
@JamesMc86 I just threw the same exe that crashes on windows 11 into a windows 10 VM and the issue does not appear there. So it is indeed windows 11 specific. But this is a very annoying bug and makes multiple viewports basically unusable on windows. It would be great if this would get a high priority label (urgent) @emilk