slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.55k stars 601 forks source link

Crash on Windows when risizing window #5307

Closed LAGonauta closed 5 months ago

LAGonauta commented 5 months ago

This doesn't seem known, but on Windows with the FemtoVG back-end it is quite simple to crash an app, you just need to resize it a lot. I haven't tried skia as I was unable to compile with it, but the software back-end seems to work fine albeit slow.

My test was on Windows 10 with an AMD GPU (RX 7600), and when I set my monitor to 144 Hz it seems easier to crash but that might be my mind playing tricks.

This is a video of the crash, with a debugger showing where the issue is: https://github.com/slint-ui/slint/assets/14236067/4ef2f765-3122-467b-848b-78cbdf942017

Unfortunately, I couldn't get a backtrace. Maybe because of the nature of the crash? Hopefully the video is enough.

If you need any more information please ping me, this is quite easily to reproduce on my side. Thanks!

tronical commented 5 months ago

Thanks for the report. The backtrace points into the GL driver crashing in SwapBuffers. I'm not sure that there's anything that we can do in practice here - OpenGL APIs aren't supposed to crash but return an error...

The best option I can offer at this point is to either switch to software rendering (Enable the renderer-skia-software feature) or try the Skia renderer in general with `renderer-skia. That'll end up using Direct3D for now.

LAGonauta commented 5 months ago

Interestingly a similar crash happens with renderer-skia-opengl, but renderer-skia works fine.

Unfortunately I couldn't get renderer-skia-vulkan to enable the Vulkan backend for some reason (no additional GPU usage, unlike OpenGL), so I couldn't test there.

I guess it might be an AMD bug?

tronical commented 5 months ago

Thanks for checking. Yes, if skia-opengl also crashes then I think this is a bug in the AMD driver. There's not much we can do beyond - in the future - changing our defaults away from OpenGL on Windows.

(Vulkan on Windows is another beast, I haven't been able yet to get Vulkan drivers working on Windows myself :)