godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.74k stars 21.12k forks source link

Crash on fullscreen switch when thread model is Multi-Threaded #72080

Open michael-nischt opened 1 year ago

michael-nischt commented 1 year ago

Godot version

v4.0.beta14.official [28a24639c]

System information

Arch and Fedora Linux, Geforce 2080 and 3080

Issue description

Setting the window mode to Window.MODE_FULLSCREEN crashes due to:

E 0:00:03:0491   _update_swap_chain: Condition "err" is true. Returning: ERR_CANT_CREATE
  <C++ Source>   drivers/vulkan/vulkan_context.cpp:1912 @ _update_swap_chain()

source link

ERROR: Condition "err" is true. Returning: ERR_CANT_CREATE
   at: _update_swap_chain (drivers/vulkan/vulkan_context.cpp:1912)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta14.official (28a24639c3c6a95b5b9828f5f02bf0dc2f5ce54b)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x3cb20) [0x7f6f5f4c7b20] (??:0)
[2] /lib64/libnvidia-glcore.so.525.78.01(+0x17bc339) [0x7f6f39fbc339] (??:0)
[3] /lib64/libnvidia-glcore.so.525.78.01(+0x17bc401) [0x7f6f39fbc401] (??:0)
[4] /lib64/libGLX_nvidia.so.0(+0x9c7bc) [0x7f6f484ea7bc] (??:0)
[5] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x4b472eb] (??:0)
[6] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x1a95173] (??:0)
[7] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x1a96224] (??:0)
[8] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x3a3f0fa] (??:0)
[9] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x398f4c1] (??:0)
[10] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x3a610c2] (??:0)
[11] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x3a3af53] (??:0)
[12] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x40d9b15] (??:0)
[13] /home/micha/Apps/Godot_v4.0-beta14_linux.x86_64() [0x4c7a1e0] (??:0)
[14] /lib64/libc.so.6(+0x8b12d) [0x7f6f5f51612d] (??:0)
[15] /lib64/libc.so.6(+0x10cbc0) [0x7f6f5f597bc0] (??:0)
-- END OF BACKTRACE --
================================================================

Steps to reproduce

  1. Set "rendering/driver/threads/thread_model" to multi-threaded in the project settings.
  2. At runtime set window.mode to Window.MODE_FULLSCREEN (after ~1 sec)
  3. Observe error in the debugger or app crash.

May crash the app or not. Depends on the scene resources / complexity ?

Minimal reproduction project

fullscreen-toggle-bug.zip

Calinou commented 1 year ago

update_swap_chain is not the cause of the crash – it's a consequence of the renderer not being able to initialize after the resolution/window mode change.