Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot freezes forever on save with small chance on Linux #74548

Open
werryxgames opened this issue Mar 7, 2023 · 31 comments
Open

Godot freezes forever on save with small chance on Linux #74548

werryxgames opened this issue Mar 7, 2023 · 31 comments

Comments

@werryxgames
Copy link

werryxgames commented Mar 7, 2023


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

4.0.stable

System information

Ubuntu

Issue description

After 10-30 minutes when i open Godot, Godot freezes forever (buttons don't work, no button hover animation, can't close Godot window). Usually it happens when Godot is saving data (scene, script etc.) and after killing process (pkill godot-engine) data is saved, but sometimes it happens when subwindow (like Project settings or Editor settings) is opening and then unsaved data is lost.
This bug only on Ubuntu. I tested on same PC on Windows (dualboot) and Godot works good on Windows

Steps to reproduce

  1. Open any project in Godot
  2. Go to Script tab
  3. Press Ctrl + S 5-13 times (tested 2 times, first time 13 saves, second time 5)

Minimal reproduction project

N/A

@werryxgames werryxgames changed the title Godot freezes forever every 10-30 minutes Godot freezes forever every 5-13 saves Mar 7, 2023
@clayjohn
Copy link
Member

clayjohn commented Mar 7, 2023

The next few times you run Godot, can you run it from the command line and then let us know what is printed when it freezes?

We need that information to be able to do anything.

@werryxgames
Copy link
Author

Godot prints nothing (only default startup info):

Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
OpenGL API 4.5 (Core Profile) Mesa 23.1.0-devel (git-60ae5b1 2023-03-04 jammy-oibaf-ppa) - Compatibility - Using Device: AMD - AMD Radeon R4 Graphics (stoney, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic)
 
Editing project: /home/werryx/GodotProjects/empty
Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
OpenGL API 4.5 (Core Profile) Mesa 23.1.0-devel (git-60ae5b1 2023-03-04 jammy-oibaf-ppa) - Compatibility - Using Device: AMD - AMD Radeon R4 Graphics (stoney, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic)
godot-2023-03-08_08.00.24.mp4

@clayjohn clayjohn added this to the 4.x milestone Mar 8, 2023
@werryxgames werryxgames changed the title Godot freezes forever every 5-13 saves Godot freezes forever on save with small chance Mar 8, 2023
@vnen
Copy link
Member

vnen commented Mar 8, 2023

I had instances of freezing as well, even when not saving. I did happen to have a debugger attached and with a pause I saw it froze on this line:

Ultimately the freeze is on xcb_wait_for_event from libxcb (before some JIT code) then on poll from libc. So it's some infinite loop in the library I assume. Maybe @bruvzg has an idea?

I also get this warning every time a window is created, including tooltips, not sure if it's related:

WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/x11/display_server_x11.cpp:5132)

For reference I'm on Arch Linux using i3wm.

@vnen
Copy link
Member

vnen commented Mar 9, 2023

I just noticed I have the same problem with Alacritty. It freezes randomly and with gdb I was able to see it stops in the same place (xcb_wait_for_event). I wonder if this a bug in libxcb rather than a misusage in Godot.

@bruvzg
Copy link
Member

bruvzg commented Mar 9, 2023

XCreateIC couldn't create wd.xic
XSetICFocus(wd.xic);

That's strange, if xinput is not available, it should never get to this part of code, I'm not sure what's going on (maybe some part is breaking after main window init, and Godot is left with invalid xi context).

@werryxgames
Copy link
Author

I ran gdb Godot_v4.0-stable_linux.x86_64 and then wrote r --path ~/GodotProjects/empty/ --editor. I saved 2 times and Godot freezed, but there was nothing in GDB (only Godot startup message and thread info), but after i pressed Ctrl-C, i saw ^C Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt. 0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 29 ../sysdeps/unix/sysv/linux/poll.c: Нет такого файла или каталога. (No such file or directory). I thought that it was because of Ctrl-C, but when i restarted Godot and pressed Ctrl-C, i got different GDB output: ^C Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt. 0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78 78 in ../sysdeps/unix/sysv/linux/clock_nanosleep.c. I pressed Ctrl-C more times and got same output (and continued with c every time), but when Godot freezed again and i pressed Ctrl-C, i got first SIGINT message (as expected)

This is first GDB output:

$ gdb Godot_v4.0-stable_linux.x86_64 
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from Godot_v4.0-stable_linux.x86_64...
(No debugging symbols found in Godot_v4.0-stable_linux.x86_64)
(gdb) r --path ~/GodotProjects/empty/ --editor
Starting program: /home/werryx/Загрузки/Godot_v4.0-stable_linux.x86_64 --path ~/GodotProjects/empty/ --editor
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 80718]
[New Thread 0x7ffff67ff640 (LWP 80720)]
[New Thread 0x7ffff5ffe640 (LWP 80721)]
[New Thread 0x7ffff57fd640 (LWP 80722)]
Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
[New Thread 0x7ffff499b640 (LWP 80723)]
[Detaching after fork from child process 80724]
[Detaching after fork from child process 80725]
[Detaching after fork from child process 80748]
[New Thread 0x7fffe47ff640 (LWP 80755)]
[New Thread 0x7fffe3ebd640 (LWP 80756)]
[New Thread 0x7fffe36bc640 (LWP 80757)]
[New Thread 0x7fffe2ebb640 (LWP 80758)]
[New Thread 0x7fffe22ba640 (LWP 80759)]
[New Thread 0x7fffe1ab9640 (LWP 80760)]
[New Thread 0x7fffe10b8640 (LWP 80763)]
[New Thread 0x7fffc3fff640 (LWP 80770)]
[Thread 0x7ffff499b640 (LWP 80723) exited]
OpenGL API 4.5 (Core Profile) Mesa 23.1.0-devel (git-d5376c3 2023-03-08 jammy-oibaf-ppa) - Compatibility - Using Device: AMD - AMD Radeon R4 Graphics (stoney, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic)
[New Thread 0x7fffc33fe640 (LWP 80771)]
[New Thread 0x7fffc2bfd640 (LWP 80772)]
[New Thread 0x7fffc220b640 (LWP 80773)]
 
[New Thread 0x7fffc1221640 (LWP 80774)]
[New Thread 0x7fffc0a20640 (LWP 80775)]
[Thread 0x7fffc0a20640 (LWP 80775) exited]
[New Thread 0x7fffa3fff640 (LWP 80776)]
[New Thread 0x7fffa222e640 (LWP 80777)]
[New Thread 0x7fffa1a2d640 (LWP 80778)]
[New Thread 0x7fffc0a20640 (LWP 80779)]
[New Thread 0x7fffa122c640 (LWP 80780)]
[New Thread 0x7fffa0a2b640 (LWP 80781)]
[Thread 0x7fffa0a2b640 (LWP 80781) exited]
[New Thread 0x7fffa0a2b640 (LWP 80782)]
[New Thread 0x7fff97fff640 (LWP 80783)]
[Thread 0x7fff97fff640 (LWP 80783) exited]
[New Thread 0x7fff97fff640 (LWP 80784)]
[Thread 0x7fff97fff640 (LWP 80784) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29	../sysdeps/unix/sysv/linux/poll.c: Нет такого файла или каталога.
(gdb) l
24	in ../sysdeps/unix/sysv/linux/poll.c
(gdb) c
Continuing.
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29	in ../sysdeps/unix/sysv/linux/poll.c
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) n
Program not restarted.
(gdb) c
Continuing.
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29	in ../sysdeps/unix/sysv/linux/poll.c
(gdb) q
A debugging session is active.

	Inferior 1 [process 80715] will be killed.

Quit anyway? (y or n) y

This is second GDB output:

$ gdb Godot_v4.0-stable_linux.x86_64 
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from Godot_v4.0-stable_linux.x86_64...
(No debugging symbols found in Godot_v4.0-stable_linux.x86_64)
(gdb) r --path ~/GodotProjects/empty/ --editor
Starting program: /home/werryx/Загрузки/Godot_v4.0-stable_linux.x86_64 --path ~/GodotProjects/empty/ --editor
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 80812]
[New Thread 0x7ffff67ff640 (LWP 80814)]
[New Thread 0x7ffff5ffe640 (LWP 80815)]
[New Thread 0x7ffff57fd640 (LWP 80816)]
Godot Engine v4.0.stable.official.92bee43ad - https://godotengine.org
[New Thread 0x7ffff499b640 (LWP 80817)]
[Detaching after fork from child process 80818]
[Detaching after fork from child process 80819]
[Detaching after fork from child process 80839]
[New Thread 0x7fffe47ff640 (LWP 80857)]
[Thread 0x7ffff499b640 (LWP 80817) exited]
[New Thread 0x7fffe3ffe640 (LWP 80858)]
[New Thread 0x7fffe36bc640 (LWP 80859)]
[New Thread 0x7fffe2ebb640 (LWP 80860)]
[New Thread 0x7fffe26ba640 (LWP 80861)]
[New Thread 0x7fffe1ab9640 (LWP 80862)]
[New Thread 0x7fffe12b8640 (LWP 80863)]
[New Thread 0x7fffe08b7640 (LWP 80864)]
OpenGL API 4.5 (Core Profile) Mesa 23.1.0-devel (git-d5376c3 2023-03-08 jammy-oibaf-ppa) - Compatibility - Using Device: AMD - AMD Radeon R4 Graphics (stoney, LLVM 15.0.6, DRM 3.47, 5.19.0-35-generic)
[New Thread 0x7fffc35be640 (LWP 80865)]
[New Thread 0x7fffc2dbd640 (LWP 80866)]
[New Thread 0x7fffc2223640 (LWP 80867)]
 
[New Thread 0x7fffc1239640 (LWP 80868)]
[New Thread 0x7fffc0a38640 (LWP 80869)]
[Thread 0x7fffc0a38640 (LWP 80869) exited]
[New Thread 0x7fffa3fff640 (LWP 80870)]
[New Thread 0x7fffa222e640 (LWP 80871)]
[New Thread 0x7fffa1a2d640 (LWP 80872)]
[New Thread 0x7fffc0a38640 (LWP 80873)]
[New Thread 0x7fffa122c640 (LWP 80874)]
[New Thread 0x7fffa0a2b640 (LWP 80875)]
[Thread 0x7fffa0a2b640 (LWP 80875) exited]
[New Thread 0x7fffa0a2b640 (LWP 80876)]
[New Thread 0x7fff97fff640 (LWP 80877)]
[Thread 0x7fff97fff640 (LWP 80877) exited]
[New Thread 0x7fff97fff640 (LWP 80878)]
[Thread 0x7fff97fff640 (LWP 80878) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	../sysdeps/unix/sysv/linux/clock_nanosleep.c: Нет такого файла или каталога.
(gdb) c
Continuing.
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
[New Thread 0x7fff97fff640 (LWP 80879)]
[Thread 0x7fff97fff640 (LWP 80879) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
[New Thread 0x7fff97fff640 (LWP 80880)]
[Thread 0x7fff97fff640 (LWP 80880) exited]
[New Thread 0x7fff97fff640 (LWP 80881)]
[Thread 0x7fff97fff640 (LWP 80881) exited]
[New Thread 0x7fff97fff640 (LWP 80885)]
[Thread 0x7fff97fff640 (LWP 80885) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
[New Thread 0x7fff97fff640 (LWP 80887)]
[Thread 0x7fff97fff640 (LWP 80887) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7ce5868 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7fffffffd150, rem=0x7fffffffd160) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78	in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
(gdb) c
Continuing.
[New Thread 0x7fff97fff640 (LWP 80888)]
[Thread 0x7fff97fff640 (LWP 80888) exited]
^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29	../sysdeps/unix/sysv/linux/poll.c: Нет такого файла или каталога.

@akien-mga
Copy link
Member

That's a good start! What you should do when it freezes is to press Ctrl-C as you did, and then run bt to get a backtrace. Ctrl-C will interrupt the execution where it currently is, and bt will print a backtrace of what steps led to the current state.

Depending on when you press Ctrl-C then backtrace may be a bit difference, you can check a few Ctrl-C + bt + c to continue and see if there are any significant differences.

@werryxgames
Copy link
Author

Backtrace:

^C
Thread 1 "Godot_v4.0-stab" received signal SIGINT, Interrupt.
0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
29	../sysdeps/unix/sysv/linux/poll.c: Нет такого файла или каталога.
(gdb) bt
#0  0x00007ffff7d18d7f in __GI___poll (fds=0x7fffffffb438, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff78c87e2 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007ffff78ca22c in xcb_wait_for_event ()
   from /lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff4b01e88 in _XReadEvents ()
   from /lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007ffff4ae682d in XIfEvent () from /lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff4b3010f in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007ffff4b28492 in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#7  0x00007ffff4b30661 in _XimRead () from /lib/x86_64-linux-gnu/libX11.so.6
#8  0x00007ffff4b1b6be in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#9  0x00007ffff4b0a396 in XDestroyIC () from /lib/x86_64-linux-gnu/libX11.so.6
#10 0x0000000000e84eee in ?? ()
#11 0x0000000002bcd5d4 in ?? ()
#12 0x0000000002c18bed in ?? ()
#13 0x0000000001ce95cc in ?? ()
#14 0x0000000001cf18f9 in ?? ()
#15 0x00000000045d8c8a in ?? ()
#16 0x0000000002d8e4ba in ?? ()
#17 0x0000000002db61a5 in ?? ()
#18 0x0000000002db62d7 in ?? ()
#19 0x0000000002b9aec5 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
#20 0x0000000002ba240c in ?? ()
#21 0x0000000002c15b75 in ?? ()
#22 0x0000000000e8e784 in ?? ()
#23 0x0000000004344e64 in ?? ()
#24 0x0000000004345fe3 in ?? ()
#25 0x0000000000e8ee2f in ?? ()
#26 0x0000000000e027e2 in ?? ()
#27 0x00007ffff7c29d90 in __libc_start_call_main (main=main@entry=0xe01660, 
    argc=argc@entry=4, argv=argv@entry=0x7fffffffde78)
    at ../sysdeps/nptl/libc_start_call_main.h:58
#28 0x00007ffff7c29e40 in __libc_start_main_impl (main=0xe01660, argc=4, 
    argv=0x7fffffffde78, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffde68)
    at ../csu/libc-start.c:392
#29 0x0000000000e2286e in ?? ()

It is Godot from official website (release build) and there is not all useful information, but building from source with debug options will take some time. Should i build debug version and repeat with it or this backtrace enough?

@akien-mga
Copy link
Member

akien-mga commented Mar 9, 2023

I think it's good enough for now, it seems to confirm what @vnen commented in #74548 (comment). vnen usually runs debug builds so he might also be able to provide a full stacktrace if needed.

BTW which window manager are you using?

@akien-mga akien-mga changed the title Godot freezes forever on save with small chance Godot freezes forever on save with small chance on Linux Mar 9, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.1 Mar 9, 2023
@werryxgames
Copy link
Author

I use GNOME

@capnm
Copy link
Contributor

capnm commented Mar 9, 2023

I had instances of freezing as well, even when not saving.

I see here (ubuntu 20.04.5 LTS) very often some thread-caused lock-downs in the interface (e.g. when it saves internally, hanging in tooltip thread, often when switching the renderer, ...) in the official 4.0 version. The git tip-dev version doesn't do that.

unrelated

Perhaps this is also related, although it works in 4.0.
If I open a gdscript file and try to save it under a different file name via the editor menu Save As
test1.gd -> test2.fd

ERROR: Another resource is loaded from path 'res://test2.gd' (possible cyclic resource inclusion).
   at: set_path (core/io/resource.cpp:75)
ERROR: Trying to unreference a SafeRefCount which is already zero is wrong and a symptom of it being misused.
Upon a SafeRefCount reaching zero any object whose lifetime is tied to it, as well as the ref count itself, must be destroyed.
Moreover, to guarantee that, no multiple threads should be racing to do the final unreferencing to zero.
   at: _check_unref_sanity (./core/templates/safe_refcount.h:173)

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.1.dev.custom_build (c6c74c2746e08b927e11a40d90dc00dfc5e6add7)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7f9c2be70090] (??:0)
[2] RefCounted::unreference() (/godot-git/./core/templates/safe_refcount.h:173)
[3] void memdelete<HashMapElement<String, Ref<GDScript> > >(HashMapElement<String, Ref<GDScript> >*) (/godot-git/./core/object/ref_counted.h:220)
[4] GDScriptCache::remove_script(String const&) (/godot-git/./core/os/memory.h:206)
[5] GDScript::~GDScript() (/godot-git/./core/templates/cowdata.h:412)
[6] void memdelete<GDScript>(GDScript*) (/godot-git/./core/os/memory.h:112)
[7] GDScriptCache::move_script(String const&, String const&) (/godot-git/./core/object/ref_counted.h:221)
[8] GDScript::set_path(String const&, bool) (/godot-git/./core/templates/hash_map.h:456)
[9] EditorNode::save_resource_in_path(Ref<Resource> const&, String const&) (/godot-git/editor/editor_node.cpp:1313)
[10] EditorNode::_dialog_action(String) (/godot-git/./core/object/ref_counted.h:230 (discriminator 2))
[11] void call_with_variant_args_helper<EditorNode, String, 0ul>(EditorNode*, void (EditorNode::*)(String), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/godot-git/./core/templates/cowdata.h:412)
[12] void call_with_variant_args<EditorNode, String>(EditorNode*, void (EditorNode::*)(String), Variant const**, int, Callable::CallError&) (/godot-git/./core/variant/binder_common.h:408)
[13] CallableCustomMethodPointer<EditorNode, String>::call(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/./core/object/callable_method_pointer.h:105)
[14] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/core/variant/callable.cpp:50)
[15] Object::emit_signalp(StringName const&, Variant const**, int) (/godot-git/core/object/object.cpp:1047)
[16] Error Object::emit_signal<String>(StringName const&, String) (/godot-git/./core/object/object.h:869)
[17] EditorFileDialog::_action_pressed() (/godot-git/editor/editor_file_dialog.cpp:503)
[18] EditorFileDialog::_file_submitted(String const&) (/godot-git/editor/editor_file_dialog.cpp:293)
[19] void call_with_variant_args_helper<EditorFileDialog, String const&, 0ul>(EditorFileDialog*, void (EditorFileDialog::*)(String const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/godot-git/./core/templates/cowdata.h:412)
[20] void call_with_variant_args<EditorFileDialog, String const&>(EditorFileDialog*, void (EditorFileDialog::*)(String const&), Variant const**, int, Callable::CallError&) (/godot-git/./core/variant/binder_common.h:408)
[21] CallableCustomMethodPointer<EditorFileDialog, String const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/./core/object/callable_method_pointer.h:105)
[22] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/core/variant/callable.cpp:50)
[23] Object::emit_signalp(StringName const&, Variant const**, int) (/godot-git/core/object/object.cpp:1047)
[24] LineEdit::gui_input(Ref<InputEvent> const&) (/godot-git/./core/object/object.h:864)
[25] Control::_call_gui_input(Ref<InputEvent> const&) (/godot-git/scene/gui/control.cpp:1746)
[26] Viewport::_gui_input_event(Ref<InputEvent>) (/godot-git/scene/main/viewport.cpp:2043)
[27] Viewport::push_input(Ref<InputEvent> const&, bool) (/godot-git/./core/object/ref_counted.h:220)
[28] Window::_window_input(Ref<InputEvent> const&) (/godot-git/scene/main/window.cpp:1369)
[29] Viewport::_sub_windows_forward_input(Ref<InputEvent> const&) (/godot-git/./core/object/ref_counted.h:220)
[30] Viewport::push_input(Ref<InputEvent> const&, bool) (/godot-git/scene/main/viewport.cpp:2820 (discriminator 1))
[31] Window::_window_input(Ref<InputEvent> const&) (/godot-git/scene/main/window.cpp:1369)
[32] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/godot-git/./core/object/ref_counted.h:220)
[33] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (/godot-git/./core/variant/binder_common.h:408)
[34] CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/./core/object/callable_method_pointer.h:105)
[35] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/godot-git/core/variant/callable.cpp:50)
[36] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (/godot-git/platform/linuxbsd/x11/display_server_x11.cpp:3592)
[37] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (/godot-git/platform/linuxbsd/x11/display_server_x11.cpp:3566)
[38] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/godot-git/./core/object/ref_counted.h:220)
[39] Input::flush_buffered_events() (/godot-git/core/input/input.cpp:940)
[40] DisplayServerX11::process_events() (/godot-git/./core/templates/local_vector.h:326)
[41] OS_LinuxBSD::run() (/godot-git/platform/linuxbsd/os_linuxbsd.cpp:878)
[42] godot.linuxbsd.editor.dev.x86_64(main+0x145) [0x562ca120e4de] (/godot-git/platform/linuxbsd/godot_linuxbsd.cpp:75)
[43] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f9c2be51083] (??:0)
[44] godot.linuxbsd.editor.dev.x86_64(_start+0x2e) [0x562ca120e2de] (??:?)
-- END OF BACKTRACE --
================================================================
Abgebrochen

@vnen
Copy link
Member

vnen commented Mar 10, 2023

@capnm the crash with "Save as" is unrelated. I reported it here: #74069

@vnen
Copy link
Member

vnen commented Mar 14, 2023

I just got a crash that I'm not sure if it's related to this, with the following message:

[xcb] Unknown sequence number while processing queue
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
godot.linuxbsd.editor.dev.x86_64.llvm: xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Though given the "this is not your fault" message this is probably a bug upstream.

Edit: For reference, this happened here on Godot source:

@werryxgames
Copy link
Author

werryxgames commented Apr 4, 2023

Godot doesn't freeze with KDE
UPD: Freezes, but 50-100 times less

@capnm
Copy link
Contributor

capnm commented Apr 4, 2023

Try to use the latest version (or compile yourself a dev version) and as someone said enable interface/editor/single_window_mode . For me it is now like about 1000x less :)

@vnen
Copy link
Member

vnen commented Apr 13, 2023

This is still happening to me randomly. I had to enable single window mode to stop it (so far it hasn't happened in single window mode).

@MewPurPur
Copy link
Contributor

MewPurPur commented Jun 24, 2023

I get this very often in the following circumstance:

  • I'm running scons and compiling Godot. My laptop is sweating and heating up, presumably having 3 of its threads busy with the compilation and leaving a single thread to do everything else. (Idk multithreading)
  • I run some Godot project while the compilation is going on.
  • Now every time I save, there's some 20% or so chance it will freeze. But normally, Godot almost never freezes for me.

@augustember
Copy link

augustember commented Sep 5, 2023

This was happening to me (I use Ubuntu 20.04 with KDE and Godot 4.1). I disabled my other monitor and that seems to have fixed it. I hope they fix this in the future.

@SonGoku-2000
Copy link

In my case, when I press "ctrl + s" and just when it reaches %100 I press again "ctrl + s" it freezes most of the times.
I don't know if this can help to find the cause of the error.

@YuriSizov YuriSizov modified the milestones: 4.2, 4.x Nov 15, 2023
@chinmayghule
Copy link

So, is this problem solved? It's still freezing on Fedora 39. Godot version is 4.2.1 (stable).

@nick07002
Copy link

Same here. Freezing a log on Ubuntu 22.04.3 LTS with Gadot 4.2.1.
It becomes unusable now.

@haowg
Copy link

haowg commented Feb 14, 2024

It's still freezing on Manjaro. Godot version is 4.2.1 (stable).

@MurphLaws
Copy link

Same for me, Ubuntu 23.10, and Godot 4.2.1 (stable)

@Erickson400
Copy link

Still happening on Fedora39 Godot 4.2.2 (Flathub). I can sometimes save for as many times as I want without problem. I think it might be random, but most frequent when actively working on a project.

@Erickson400
Copy link

For anyone still having this issue. A temporary solution is to enable single window mode on editor settings on the interface/editor catalog. It now doesn't freeze and Godot finally works like normal. This settings doesn't change your workflow at all, so its a plus. 👍

@NangiDev
Copy link

Not sure if this is related, but I experienced freezing editor on Ubuntu 24.04, Godot 4.3, when saving script files.
I disabled the Multi window in Editor settings and now I haven't experienced the freeze the last month.

@werryxgames
Copy link
Author

I can't reproduce this issue for weeks now. I think that following may be related but don't know exact reason:

  1. I changed distro and window manager from Ubuntu/GNOME to Arch/Hyprland. Before that I was using Arch/Sway and issue was still reproducible.
  2. Wayland support was officially added to Godot (in backtrace there were names starting with X and directories/files with x11 in name).
  3. I'm still using Single Window Mode as a workaround for this issue, but even with it Godot was crashing like 2-20 times per week before. I tried disabling it, but I'm using Hyprland so Godot is almost unusable with multiple windows in tiling window manager.
  4. I bought a new laptop. It has SSD so scene save / resource load time is much faster now. Can't test on an old one, because it's now a Debian server without GUI.

Can anybody reproduce this issue on one of latest (4.4dev) versions? If yes, are you using X11 or Wayland?

@MewPurPur
Copy link
Contributor

MewPurPur commented Nov 30, 2024

I get this very often in the following circumstance:

  • I'm running scons and compiling Godot. My laptop is sweating and heating up, presumably having 3 of its threads busy with the compilation and leaving a single thread to do everything else. (Idk multithreading)
  • I run some Godot project while the compilation is going on.
  • Now every time I save, there's some 20% or so chance it will freeze. But normally, Godot almost never freezes for me.

I got a new laptop which was an upgrade from 4 threads to 12. I pretty much stopped getting this, but now I was doing some Godot dev while also compiling Godot, and I got two such freezes consecutively. There may be many bugs involved in such freezes, but it seems pretty certain now that this happens when there are a lot of occupied threads.

Edit: Godot v4.3.stable - Pop!_OS 22.04 LTS - X11 - GLES3 (Compatibility) - Mesa Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1235U (12 Threads)

@adamscott
Copy link
Member

I get this very often in the following circumstance:

  • I'm running scons and compiling Godot. My laptop is sweating and heating up, presumably having 3 of its threads busy with the compilation and leaving a single thread to do everything else. (Idk multithreading)
  • I run some Godot project while the compilation is going on.
  • Now every time I save, there's some 20% or so chance it will freeze. But normally, Godot almost never freezes for me.

I got a new laptop which was an upgrade from 4 threads to 12. I pretty much stopped getting this, but now I was doing some Godot dev while also compiling Godot, and I got two such freezes consecutively. There may be many bugs involved in such freezes, but it seems pretty certain now that this happens when there are a lot of occupied threads.

@RandomShaper This smells threading deadlocks.

@RandomShaper
Copy link
Member

It'd be cool if we could have a back trace from a debug build, at the point the editor freezes. That'd help me a lot.

@palapapa
Copy link

palapapa commented Dec 12, 2024

I had instances of freezing as well, even when not saving. I did happen to have a debugger attached and with a pause I saw it froze on this line:

godot/platform/linuxbsd/x11/display_server_x11.cpp

Line 2568 in 9b9bb41
XSetICFocus(wd.xic);

Ultimately the freeze is on xcb_wait_for_event from libxcb (before some JIT code) then on poll from libc. So it's some infinite loop in the library I assume. Maybe @bruvzg has an idea?

I also get this warning every time a window is created, including tooltips, not sure if it's related:

WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/x11/display_server_x11.cpp:5132)

For reference I'm on Arch Linux using i3wm.

I came across this accidentally when googling about my problem. Apparently, this problem is not exclusive to Godot. I currently have a problem on Gentoo where the moment I press a key when a game has focus, it freezes forever. Pressing mouse buttons doesn't cause issues. I have tried attaching GDB to the stuck game and found that the game was stuck on that exact same function you mentioned.

EDIT: It turned out that IBus was the one causing this issue. Disabling it made games no longer freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests