egui icon indicating copy to clipboard operation
egui copied to clipboard

Crash Closing A Deferred Viewport

Open JamesWiresmith opened this issue 1 year ago • 5 comments

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

  1. Run the multiple viewports example with cargo run -p multiple_viewports.
  2. Tick Show Deferred Viewport.
  3. Click the close window button on the new window.
  4. 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.

JamesWiresmith avatar Jul 17 '24 17:07 JamesWiresmith

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!

image

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=????????????????

JamesWiresmith avatar Jul 17 '24 18:07 JamesWiresmith

OS: Windows 10 egui: Master Version

According to the above conditions, there is no problem.

rustbasic avatar Aug 02 '24 15:08 rustbasic

I'm still seeing this on the latest master, perhaps it is Windows 11 specific?

JamesWiresmith avatar Aug 09 '24 11:08 JamesWiresmith

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)

Erik1000 avatar Oct 15 '25 12:10 Erik1000

@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

Erik1000 avatar Oct 15 '25 13:10 Erik1000