Crash when using `OS.move_to_trash()` on a folder that does not have write permission
Tested versions
Reproducible in: v4.6.dev.custom_build [fbc953976], v4.6.dev4.official [bd2ca13c6] Not reproducible in: v4.6.dev3.official [9d84f3d13], v4.6.dev2.official [7864ac801]
System information
Godot v4.6.dev (fbc953976) - Linux Mint 22.2 (Zara) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - integrated AMD Radeon 780M Graphics (RADV PHOENIX) - AMD Ryzen 7 8745H w/ Radeon 780M Graphics (16 threads) - 25.22 GiB memory
Issue description
After changing the permissions of directory 'a' to 555, running the following script may cause the editor to crash and even affect OS input.
@tool
extends EditorScript
func _run() -> void:
OS.move_to_trash("a")
Logs
gio: file:///home/bee/code/godot/b/a: 无法将文件 /home/bee/code/godot/b/a 丢到回收站:权限不够
ERROR: Could not create child process: kioclient5
at: execute (drivers/unix/os_unix.cpp:936)
GDScript backtrace (most recent call first):
[0] _run (res://test.gd:5)
ERROR: Could not create child process: gvfs-trash
at: execute (drivers/unix/os_unix.cpp:936)
GDScript backtrace (most recent call first):
[0] _run (res://test.gd:5)
X connection to :0 broken (explicit kill or server shutdown).
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: _skip_save_
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: servers
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: luminance_buffers
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: color_upscaled
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: quarter_texture
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: half_texture
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: sky_buffers
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: mip_level
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: ssr
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: rb_ssr
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: rb_ssil
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: reflection
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: final
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: rb_ssao
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: back_color
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: back_depth
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: normal_roughness
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: VRS
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: Fog
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: sdfgi
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: EditorRect2D
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: _editor_region_rect_enabled
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: ShaderCompilation
at: unref (core/string/string_name.cpp:116)
While attempting to print an error, another error was printed:
ERROR: BUG: Unreferenced static string to 0: .
at: unref (core/string/string_name.cpp:116)
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.6.dev.custom_build (fbc9539764c8c932b62116146a6c8a7f3f5e67f7)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[xcb] Unknown sequence number while processing queue
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
godot-san-dev: ../../src/xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Typing with the keyboard and mouse became sluggish. Before it could get any worse, I had to restart my machine.
Using which to check if the command exists before executing it makes things much better.
Patch
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index eb2e71c28c..2b6ff749f1 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -1044,25 +1044,34 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
List<String> args;
args.push_back(path);
- args.push_front("trash"); // The command is `gio trash <file_name>` so we add it before the path.
- Error result = execute("gio", args, nullptr, &err_code); // For GNOME based machines.
+ Error result = execute("which", { "gio" }, nullptr, &err_code);
if (result == OK && err_code == 0) { // Success.
- return OK;
+ args.push_front("trash"); // The command is `gio trash <file_name>` so we add it before the path.
+ result = execute("gio", args, nullptr, &err_code); // For GNOME based machines.
+ if (result == OK && err_code == 0) {
+ return OK;
+ }
}
- args.pop_front();
- args.push_front("move");
- args.push_back("trash:/"); // The command is `kioclient5 move <file_name> trash:/`.
- result = execute("kioclient5", args, nullptr, &err_code); // For KDE based machines.
- if (result == OK && err_code == 0) {
- return OK;
+ result = execute("which", { "kioclient5" }, nullptr, &err_code);
+ if (result == OK && err_code == 0) { // Success.
+ args.pop_front();
+ args.push_front("move");
+ args.push_back("trash:/"); // The command is `kioclient5 move <file_name> trash:/`.
+ result = execute("kioclient5", args, nullptr, &err_code); // For KDE based machines.
+ if (result == OK && err_code == 0) {
+ return OK;
+ }
}
- args.pop_front();
- args.pop_back();
- result = execute("gvfs-trash", args, nullptr, &err_code); // For older Linux machines.
- if (result == OK && err_code == 0) {
- return OK;
+ result = execute("which", { "gvfs-trash" }, nullptr, &err_code);
+ if (result == OK && err_code == 0) { // Success.
+ args.pop_front();
+ args.pop_back();
+ result = execute("gvfs-trash", args, nullptr, &err_code); // For older Linux machines.
+ if (result == OK && err_code == 0) {
+ return OK;
+ }
}
// If the commands `kioclient5`, `gio` or `gvfs-trash` don't work on the system we do it manually.
Error message received after applying the patch:
/usr/bin/gio
gio: file:///home/bee/code/godot/b/a: 无法将文件 /home/bee/code/godot/b/a 丢到回收站:权限不够
ERROR: Failed to open '/home/bee/code/godot/b/a'.
at: copy (core/io/dir_access.cpp:420)
GDScript backtrace (most recent call first):
[0] _run (res://test.gd:5)
ERROR: Can't rename file "a" to "/a.1"
at: move_to_trash (platform/linuxbsd/os_linuxbsd.cpp:1166)
GDScript backtrace (most recent call first):
[0] _run (res://test.gd:5)
Steps to reproduce
- Create a directory named "a" in the project directory;
- Use
chmodto set the permissions of directory "a" to555; - Create a script to execute
OS.move_to_trash("a").
Minimal reproduction project (MRP)
N/A
Possibly related:
- https://github.com/godotengine/godot/issues/111813
- https://github.com/godotengine/godot/issues/67137
Can you test if this happens only in 4.6?
Not reproducible in: v4.6.dev3.official [9d84f3d13], v4.6.dev2.official [7864ac801]
Crash bisected to: e2caff9a06ca4683aa65042556e8a5661ab4d4a7 (#106164) CC @lodetrick
gio: file:///home/bee/code/godot/b/a: 无法将文件 /home/bee/code/godot/b/a 丢到回收站:权限不够
ERROR: Could not create child process: kioclient5
at: execute (drivers/unix/os_unix.cpp:936)
GDScript backtrace (most recent call first):
[0] _run (res://test.gd:5)
[xcb] Unknown sequence number while processing queue
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
godot-llvm-dev: ../../src/xcb_io.c:278: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
The input lag seems to be a separate issue.
The changes in #106164 shouldn't have an impact on this, they were just about the dock system (very front end). I'm also not on a linux machine, so I wasn't able to reproduce the crash unfortunately.
I can't reproduce the crash on Fedora 43 KDE.
The changes in #106164 shouldn't have an impact on this, they were just about the dock system (very front end). I'm also not on a linux machine, so I wasn't able to reproduce the crash unfortunately.
It's likely a backlog of issues caused by certain methods or signals. This commit was just the spark that ignited the fire.
Running this code in a scene outside the editor will not trigger a crash.
OS.move_to_trash(ProjectSettings.globalize_path("res://a/"))
https://github.com/godotengine/godot/blob/78d91947f689ea9eb4049f4d6371c0dfcfa0e62f/scene/gui/file_dialog.cpp#L1066-L1067
The issue was initially discovered while testing the deletion of a directory in EditorFileDialog.
After running the EditorScript in the editor, a new godot process will be created (the number of godot processes will be 2).
Then the original process crashes and exits. Below is the bt info for the second process.
bt info e2caff9a0
#0 0x00007a35de31b4fd in __GI___poll (fds=0x7fff3a50b788, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007a35d803a8ca in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2 0x00007a35d803aef0 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#3 0x00007a35d803bedd in xcb_wait_for_reply64 () from /lib/x86_64-linux-gnu/libxcb.so.1
#4 0x00007a35d809d62d in _XReply () from /lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007a35d808d448 in XQueryPointer () from /lib/x86_64-linux-gnu/libX11.so.6
#6 0x00005fd678299ddd in DisplayServerX11::mouse_get_position (this=0x5fd6aca19c70) at platform/linuxbsd/x11/display_server_x11.cpp:623
#7 0x00005fd67bf6b309 in Viewport::get_mouse_position (this=0x5fd6aedfbb60) at scene/main/viewport.cpp:1455
#8 0x00005fd67be6ef64 in CanvasItem::get_global_mouse_position (this=0x5fd6b6ae6450) at scene/main/canvas_item.cpp:1277
#9 0x00005fd67be6f0d3 in CanvasItem::get_local_mouse_position (this=0x5fd6b6ae6450) at scene/main/canvas_item.cpp:1284
#10 0x00005fd67c3c8b8f in TabBar::_update_hover (this=0x5fd6b6ae6450) at scene/gui/tab_bar.cpp:1145
#11 0x00005fd67c3c94c3 in TabBar::_update_cache (this=0x5fd6b6ae6450, p_update_hover=true) at scene/gui/tab_bar.cpp:1271
#12 0x00005fd67c3cf178 in TabBar::set_tab_icon (this=0x5fd6b6ae6450, p_tab=0, p_icon=...) at scene/gui/tab_bar.cpp:989
#13 0x00005fd67c3f1df3 in TabContainer::set_tab_icon (this=0x5fd6b6ae58d0, p_tab=0, p_icon=...) at scene/gui/tab_container.cpp:866
#14 0x00005fd67ac7b068 in EditorLog::_set_dock_tab_icon (this=0x5fd6b6b0cab0, p_icon=...) at editor/editor_log.cpp:283
#15 0x00005fd67ac7b57f in EditorLog::_add_log_line (this=0x5fd6b6b0cab0, p_message=..., p_replace_previous=false) at editor/editor_log.cpp:410
#16 0x00005fd67ac7b26c in EditorLog::_process_message (this=0x5fd6b6b0cab0, p_msg=..., p_type=EditorLog::MSG_TYPE_ERROR, p_clear=true) at editor/editor_log.cpp:257
#17 0x00005fd67ac78b36 in EditorLog::add_message (this=0x5fd6b6b0cab0, p_msg=..., p_type=EditorLog::MSG_TYPE_ERROR) at editor/editor_log.cpp:274
#18 0x00005fd67ac78a91 in EditorLog::_error_handler (p_self=0x5fd6b6b0cab0, p_func=0x5fd6782349f5 <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5fd677f7aa73 <.L.str.10> "drivers/unix/os_unix.cpp", p_line=936, p_error=0x5fd6cebc9370 "Could not create child process: kioclient5", p_errorexp=0x5fd678118630 <.L.str.99> "", p_editor_notify=false,
p_type=ERR_HANDLER_ERROR) at editor/editor_log.cpp:64
#19 0x00005fd67e731d48 in _err_print_error (p_function=0x5fd6782349f5 <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5fd677f7aa73 <.L.str.10> "drivers/unix/os_unix.cpp", p_line=936, p_error=0x5fd6cebc9370 "Could not create child process: kioclient5", p_message=0x5fd678118630 <.L.str.99> "", p_editor_notify=false, p_type=ERR_HANDLER_ERROR)
at core/error/error_macros.cpp:128
#20 0x00005fd67e731dff in _err_print_error (p_function=0x5fd6782349f5 <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5fd677f7aa73 <.L.str.10> "drivers/unix/os_unix.cpp", p_line=936, p_error=..., p_editor_notify=false, p_type=ERR_HANDLER_ERROR) at core/error/error_macros.cpp:102
#21 0x00005fd67a97000e in OS_Unix::execute (this=0x7fff3a5243d8, p_path=..., p_arguments=..., r_pipe=0x0, r_exitcode=0x7fff3a51ca04, read_stderr=false, p_pipe_mutex=0x0, p_open_console=false) at drivers/unix/os_unix.cpp:936
#22 0x00005fd678280398 in OS_LinuxBSD::move_to_trash (this=0x7fff3a5243d8, p_path=...) at platform/linuxbsd/os_linuxbsd.cpp:1053
#23 0x00005fd67df2df15 in CoreBind::OS::move_to_trash (this=0x5fd6ac414c90, p_path=...) at core/core_bind.cpp:634
#24 0x00005fd67df6701e in call_with_validated_variant_args_retc_helper<__UnexistingClass, Error, String const&, 0ul> (p_instance=0x5fd6ac414c90,
p_method=(enum Error (__UnexistingClass::*)(const class __UnexistingClass * const, const class String &)) 0x5fd67df2def0 <CoreBind::OS::move_to_trash(String const&) const>, p_args=0x7fff3a51cc48, r_ret=0x7fff3a51cc30)
at ./core/variant/binder_common.h:299
#25 0x00005fd67df66f75 in call_with_validated_object_instance_args_retc<__UnexistingClass, Error, String const&> (base=0x5fd6ac414c90,
p_method=(enum Error (__UnexistingClass::*)(const class __UnexistingClass * const, const class String &)) 0x5fd67df2def0 <CoreBind::OS::move_to_trash(String const&) const>, p_args=0x7fff3a51cc48, r_ret=0x7fff3a51cc30)
at ./core/variant/binder_common.h:586
#26 0x00005fd67df66b25 in MethodBindTRC<Error, String const&>::validated_call (this=0x5fd6ac3e7180, p_object=0x5fd6ac414c90, p_args=0x7fff3a51cc48, r_ret=0x7fff3a51cc30) at ./core/object/method_bind.h:622
#27 0x00005fd6795a1cf9 in GDScriptFunction::call (this=0x5fd6ce92b000, p_instance=0x5fd6d25a5620, p_args=0x0, p_argcount=0, r_err=..., p_state=0x0) at modules/gdscript/gdscript_vm.cpp:2286
#28 0x00005fd679409ab4 in GDScriptInstance::callp (this=0x5fd6d25a5620, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at modules/gdscript/gdscript.cpp:2064
#29 0x00005fd67bb5dfec in EditorScript::_gdvirtual__run_call (this=0x5fd6d24346c0) at editor/script/editor_script.h:46
#30 0x00005fd67bb5ddd5 in EditorScript::run (this=0x5fd6d24346c0) at editor/script/editor_script.cpp:59
--Type <RET> for more, q to quit, c to continue without paging--
#31 0x00005fd67acbb741 in EditorNode::run_editor_script (this=0x5fd6aedf36c0, p_script=...) at editor/editor_node.cpp:6074
#32 0x00005fd67bb94779 in ScriptEditor::_menu_option (this=0x5fd6b9dcc870, p_option=20) at editor/script/script_editor_plugin.cpp:1607
#33 0x00005fd67bbbb362 in call_with_variant_args_helper<ScriptEditor, int, 0ul> (p_instance=0x5fd6b9dcc870, p_method=(void (ScriptEditor::*)(class ScriptEditor * const, int)) 0x5fd67bb93010 <ScriptEditor::_menu_option(int)>,
p_args=0x7fff3a5229f0, r_error=...) at ./core/variant/binder_common.h:223
#34 0x00005fd67bbbb2b9 in call_with_variant_args<ScriptEditor, int> (p_instance=0x5fd6b9dcc870, p_method=(void (ScriptEditor::*)(class ScriptEditor * const, int)) 0x5fd67bb93010 <ScriptEditor::_menu_option(int)>, p_args=0x7fff3a5229f0,
p_argcount=1, r_error=...) at ./core/variant/binder_common.h:337
#35 0x00005fd67bbbb188 in CallableCustomMethodPointer<ScriptEditor, void, int>::call (this=0x5fd6b9eef7d0, p_arguments=0x7fff3a5229f0, p_argcount=1, r_return_value=..., r_call_error=...) at ./core/object/callable_method_pointer.h:103
#36 0x00005fd67e2b9b46 in Callable::callp (this=0x7fff3a5228c8, p_arguments=0x7fff3a5229f0, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#37 0x00005fd67e673a77 in Object::emit_signalp (this=0x5fd6b9e66000, p_name=..., p_args=0x7fff3a5229f0, p_argcount=1) at core/object/object.cpp:1341
#38 0x00005fd67befeb12 in Node::emit_signalp (this=0x5fd6b9e66000, p_name=..., p_args=0x7fff3a5229f0, p_argcount=1) at scene/main/node.cpp:4166
#39 0x00005fd678c4473d in Object::emit_signal<int> (this=0x5fd6b9e66000, p_name=..., p_args=20) at ./core/object/object.h:967
#40 0x00005fd67c2bf2ff in PopupMenu::activate_item (this=0x5fd6b9e66000, p_idx=26) at scene/gui/popup_menu.cpp:2774
#41 0x00005fd67c2c2b30 in PopupMenu::_input_from_window_internal (this=0x5fd6b9e66000, p_event=...) at scene/gui/popup_menu.cpp:688
#42 0x00005fd67c2c167b in PopupMenu::_input_from_window (this=0x5fd6b9e66000, p_event=...) at scene/gui/popup_menu.cpp:468
#43 0x00005fd67bfcdafe in Window::_window_input (this=0x5fd6b9e66000, p_ev=...) at scene/main/window.cpp:1828
#44 0x00005fd67bff1228 in call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul> (p_instance=0x5fd6b9e66000,
p_method=(void (Window::*)(class Window * const, const class Ref<InputEvent> &)) 0x5fd67bfcd9f0 <Window::_window_input(Ref<InputEvent> const&)>, p_args=0x7fff3a523200, r_error=...) at ./core/variant/binder_common.h:223
#45 0x00005fd67bff1179 in call_with_variant_args<Window, Ref<InputEvent> const&> (p_instance=0x5fd6b9e66000,
p_method=(void (Window::*)(class Window * const, const class Ref<InputEvent> &)) 0x5fd67bfcd9f0 <Window::_window_input(Ref<InputEvent> const&)>, p_args=0x7fff3a523200, p_argcount=1, r_error=...) at ./core/variant/binder_common.h:337
#46 0x00005fd67bff1048 in CallableCustomMethodPointer<Window, void, Ref<InputEvent> const&>::call (this=0x5fd6d272c3b0, p_arguments=0x7fff3a523200, p_argcount=1, r_return_value=..., r_call_error=...)
at ./core/object/callable_method_pointer.h:103
#47 0x00005fd67e2b9b46 in Callable::callp (this=0x7fff3a523358, p_arguments=0x7fff3a523200, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#48 0x00005fd6782bb8e1 in Callable::call<Ref<InputEvent> > (this=0x7fff3a523358, p_args=...) at ./core/variant/variant.h:948
#49 0x00005fd6782ac295 in DisplayServerX11::_dispatch_input_event (this=0x5fd6aca19c70, p_event=...) at platform/linuxbsd/x11/display_server_x11.cpp:4496
#50 0x00005fd6782ac05d in DisplayServerX11::_dispatch_input_events (p_event=...) at platform/linuxbsd/x11/display_server_x11.cpp:4472
#51 0x00005fd67e24f5d0 in Input::_parse_input_event_impl (this=0x5fd6ac1a0890, p_event=..., p_is_emulated=false) at core/input/input.cpp:978
#52 0x00005fd67e24c876 in Input::flush_buffered_events (this=0x5fd6ac1a0890) at core/input/input.cpp:1261
#53 0x00005fd6782b0a62 in DisplayServerX11::process_events (this=0x5fd6aca19c70) at platform/linuxbsd/x11/display_server_x11.cpp:5635
#54 0x00005fd67828012c in OS_LinuxBSD::run (this=0x7fff3a5243d8) at platform/linuxbsd/os_linuxbsd.cpp:985
#55 0x00005fd678295c3e in main (argc=4, argv=0x7fff3a524a08) at platform/linuxbsd/godot_linuxbsd.cpp:85
bt info fbc953976
#0 0x000074d69ef1b4fd in __GI___poll (fds=0x7ffe2de38fc8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x000074d69149f8ca in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#2 0x000074d69149fef0 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
#3 0x000074d6914a0edd in xcb_wait_for_reply64 () from /lib/x86_64-linux-gnu/libxcb.so.1
#4 0x000074d69150262d in _XReply () from /lib/x86_64-linux-gnu/libX11.so.6
#5 0x000074d6914f2448 in XQueryPointer () from /lib/x86_64-linux-gnu/libX11.so.6
#6 0x00005b2febd7669d in DisplayServerX11::mouse_get_position (this=0x5b301dde4610) at platform/linuxbsd/x11/display_server_x11.cpp:642
#7 0x00005b2fefbd0bc0 in Viewport::get_mouse_position (this=0x5b30215ef850) at scene/main/viewport.cpp:1459
#8 0x00005b2fefad036b in CanvasItem::get_global_mouse_position (this=0x5b302a049820) at scene/main/canvas_item.cpp:1271
#9 0x00005b2fefad04da in CanvasItem::get_local_mouse_position (this=0x5b302a049820) at scene/main/canvas_item.cpp:1278
#10 0x00005b2ff004b4df in TabBar::_update_hover (this=0x5b302a049820) at scene/gui/tab_bar.cpp:1142
#11 0x00005b2ff004be13 in TabBar::_update_cache (this=0x5b302a049820, p_update_hover=true) at scene/gui/tab_bar.cpp:1268
#12 0x00005b2ff0051b68 in TabBar::set_tab_icon (this=0x5b302a049820, p_tab=0, p_icon=...) at scene/gui/tab_bar.cpp:986
#13 0x00005b2ff0072b28 in TabContainer::set_tab_icon (this=0x5b302a038770, p_tab=0, p_icon=...) at scene/gui/tab_container.cpp:931
#14 0x00005b2feec6c3ad in EditorDockManager::_update_tab_style (this=0x5b3021c43540, p_dock=0x5b302a075ff0) at editor/docks/editor_dock_manager.cpp:566
#15 0x00005b2feec7d363 in call_with_variant_args_helper<EditorDockManager, EditorDock*, 0ul> (p_instance=0x5b3021c43540,
p_method=(void (EditorDockManager::*)(class EditorDockManager * const, class EditorDock *)) 0x5b2feec6be80 <EditorDockManager::_update_tab_style(EditorDock*)>, p_args=0x7ffe2de39c30, r_error=...)
at ./core/variant/binder_common.h:224
#16 0x00005b2feec7d2b9 in call_with_variant_args<EditorDockManager, EditorDock*> (p_instance=0x5b3021c43540,
p_method=(void (EditorDockManager::*)(class EditorDockManager * const, class EditorDock *)) 0x5b2feec6be80 <EditorDockManager::_update_tab_style(EditorDock*)>, p_args=0x7ffe2de39c30, p_argcount=1, r_error=...)
at ./core/variant/binder_common.h:338
#17 0x00005b2feec7d188 in CallableCustomMethodPointer<EditorDockManager, void, EditorDock*>::call (this=0x5b302a0dc980, p_arguments=0x7ffe2de39c30, p_argcount=1, r_return_value=..., r_call_error=...)
at ./core/object/callable_method_pointer.h:103
#18 0x00005b2ff1fd0026 in Callable::callp (this=0x5b302a0dc200, p_arguments=0x7ffe2de39c30, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#19 0x00005b2ff1fd4efd in CallableCustomBind::call (this=0x5b302a0dc1f0, p_arguments=0x0, p_argcount=0, r_return_value=..., r_call_error=...) at core/variant/callable_bind.cpp:150
#20 0x00005b2ff1fd0026 in Callable::callp (this=0x7ffe2de39f38, p_arguments=0x0, p_argcount=0, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#21 0x00005b2ff239f287 in Object::emit_signalp (this=0x5b302a075ff0, p_name=..., p_args=0x0, p_argcount=0) at core/object/object.cpp:1361
#22 0x00005b2fefb617c9 in Node::emit_signalp (this=0x5b302a075ff0, p_name=..., p_args=0x0, p_argcount=0) at scene/main/node.cpp:4189
#23 0x00005b2fec7360e0 in Object::emit_signal<>(StringName const&) (this=0x5b302a075ff0, p_name=...) at ./core/object/object.h:978
#24 0x00005b2feec5eefc in EditorDock::set_force_show_icon (this=0x5b302a075ff0, p_force=true) at editor/docks/editor_dock.cpp:167
#25 0x00005b2fee89a2a9 in EditorLog::_set_dock_tab_icon (this=0x5b302a075ff0, p_icon=...) at editor/editor_log.cpp:292
#26 0x00005b2fee89a7bf in EditorLog::_add_log_line (this=0x5b302a075ff0, p_message=..., p_replace_previous=false) at editor/editor_log.cpp:418
#27 0x00005b2fee89a4ac in EditorLog::_process_message (this=0x5b302a075ff0, p_msg=..., p_type=EditorLog::MSG_TYPE_ERROR, p_clear=true) at editor/editor_log.cpp:269
#28 0x00005b2fee897d06 in EditorLog::add_message (this=0x5b302a075ff0, p_msg=..., p_type=EditorLog::MSG_TYPE_ERROR) at editor/editor_log.cpp:286
#29 0x00005b2fee897c61 in EditorLog::_error_handler (p_self=0x5b302a075ff0, p_func=0x5b2febd0e32d <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5b2feba4415a <.L.str.11> "drivers/unix/os_unix.cpp", p_line=936, p_error=0x5b302725e180 "Could not create child process: kioclient5", p_errorexp=0x5b2febbecc46 <.L.str.99> "", p_editor_notify=false,
p_type=ERR_HANDLER_ERROR) at editor/editor_log.cpp:66
#30 0x00005b2ff2462a78 in _err_print_error (p_function=0x5b2febd0e32d <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5b2feba4415a <.L.str.11> "drivers/unix/os_unix.cpp", p_line=936, p_error=0x5b302725e180 "Could not create child process: kioclient5", p_message=0x5b2febbecc46 <.L.str.99> "", p_editor_notify=false, p_type=ERR_HANDLER_ERROR)
at core/error/error_macros.cpp:128
--Type <RET> for more, q to quit, c to continue without paging--c
#31 0x00005b2ff2462b2f in _err_print_error (p_function=0x5b2febd0e32d <.L__FUNCTION__._ZN7OS_Unix7executeERK6StringRK4ListIS0_16DefaultAllocatorEPS0_PibP9MutexImplISt15recursive_mutexEb> "execute",
p_file=0x5b2feba4415a <.L.str.11> "drivers/unix/os_unix.cpp", p_line=936, p_error=..., p_editor_notify=false, p_type=ERR_HANDLER_ERROR) at core/error/error_macros.cpp:102
#32 0x00005b2fee52f0de in OS_Unix::execute (this=0x7ffe2de52600, p_path=..., p_arguments=..., r_pipe=0x0, r_exitcode=0x7ffe2de4ab64, read_stderr=false, p_pipe_mutex=0x0, p_open_console=false) at drivers/unix/os_unix.cpp:936
#33 0x00005b2febd5c1d8 in OS_LinuxBSD::move_to_trash (this=0x7ffe2de52600, p_path=...) at platform/linuxbsd/os_linuxbsd.cpp:1056
#34 0x00005b2ff1c38f55 in CoreBind::OS::move_to_trash (this=0x5b301d803690, p_path=...) at core/core_bind.cpp:636
#35 0x00005b2ff1c7275e in call_with_validated_variant_args_retc_helper<__UnexistingClass, Error, String const&, 0ul> (p_instance=0x5b301d803690,
p_method=(enum Error (__UnexistingClass::*)(const class __UnexistingClass * const, const class String &)) 0x5b2ff1c38f30 <CoreBind::OS::move_to_trash(String const&) const>, p_args=0x7ffe2de4ada8, r_ret=0x7ffe2de4ad90)
at ./core/variant/binder_common.h:300
#36 0x00005b2ff1c726b5 in call_with_validated_object_instance_args_retc<__UnexistingClass, Error, String const&> (base=0x5b301d803690,
p_method=(enum Error (__UnexistingClass::*)(const class __UnexistingClass * const, const class String &)) 0x5b2ff1c38f30 <CoreBind::OS::move_to_trash(String const&) const>, p_args=0x7ffe2de4ada8, r_ret=0x7ffe2de4ad90)
at ./core/variant/binder_common.h:587
#37 0x00005b2ff1c72255 in MethodBindTRC<Error, String const&>::validated_call (this=0x5b301d7d4d20, p_object=0x5b301d803690, p_args=0x7ffe2de4ada8, r_ret=0x7ffe2de4ad90) at ./core/object/method_bind.h:622
#38 0x00005b2fed1454c9 in GDScriptFunction::call (this=0x5b30413f4370, p_instance=0x5b303e219420, p_args=0x0, p_argcount=0, r_err=..., p_state=0x0) at modules/gdscript/gdscript_vm.cpp:2289
#39 0x00005b2fecfaa194 in GDScriptInstance::callp (this=0x5b303e219420, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at modules/gdscript/gdscript.cpp:2059
#40 0x00005b2fef7abcfc in EditorScript::_gdvirtual__run_call (this=0x5b30413f3580) at editor/script/editor_script.h:46
#41 0x00005b2fef7abae5 in EditorScript::run (this=0x5b30413f3580) at editor/script/editor_script.cpp:63
#42 0x00005b2fee8dcad1 in EditorNode::run_editor_script (this=0x5b30215df8f0, p_script=...) at editor/editor_node.cpp:6321
#43 0x00005b2fef7e84b0 in ScriptEditor::_menu_option (this=0x5b302cc13180, p_option=20) at editor/script/script_editor_plugin.cpp:1594
#44 0x00005b2fef810902 in call_with_variant_args_helper<ScriptEditor, int, 0ul> (p_instance=0x5b302cc13180, p_method=(void (ScriptEditor::*)(class ScriptEditor * const, int)) 0x5b2fef7e6ce0 <ScriptEditor::_menu_option(int)>,
p_args=0x7ffe2de50b60, r_error=...) at ./core/variant/binder_common.h:224
#45 0x00005b2fef810859 in call_with_variant_args<ScriptEditor, int> (p_instance=0x5b302cc13180, p_method=(void (ScriptEditor::*)(class ScriptEditor * const, int)) 0x5b2fef7e6ce0 <ScriptEditor::_menu_option(int)>, p_args=0x7ffe2de50b60,
p_argcount=1, r_error=...) at ./core/variant/binder_common.h:338
#46 0x00005b2fef810728 in CallableCustomMethodPointer<ScriptEditor, void, int>::call (this=0x5b302cd384f0, p_arguments=0x7ffe2de50b60, p_argcount=1, r_return_value=..., r_call_error=...) at ./core/object/callable_method_pointer.h:103
#47 0x00005b2ff1fd0026 in Callable::callp (this=0x7ffe2de50a38, p_arguments=0x7ffe2de50b60, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#48 0x00005b2ff239f287 in Object::emit_signalp (this=0x5b302ccb2cb0, p_name=..., p_args=0x7ffe2de50b60, p_argcount=1) at core/object/object.cpp:1361
#49 0x00005b2fefb617c9 in Node::emit_signalp (this=0x5b302ccb2cb0, p_name=..., p_args=0x7ffe2de50b60, p_argcount=1) at scene/main/node.cpp:4189
#50 0x00005b2fec7d36fd in Object::emit_signal<int> (this=0x5b302ccb2cb0, p_name=..., p_args=20) at ./core/object/object.h:978
#51 0x00005b2feff31c6f in PopupMenu::activate_item (this=0x5b302ccb2cb0, p_idx=26) at scene/gui/popup_menu.cpp:2884
#52 0x00005b2feff35966 in PopupMenu::_input_from_window_internal (this=0x5b302ccb2cb0, p_event=...) at scene/gui/popup_menu.cpp:706
#53 0x00005b2feff3433b in PopupMenu::_input_from_window (this=0x5b302ccb2cb0, p_event=...) at scene/gui/popup_menu.cpp:479
#54 0x00005b2fefc36814 in Window::_window_input (this=0x5b302ccb2cb0, p_ev=...) at scene/main/window.cpp:1843
#55 0x00005b2fefc5a3f8 in call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul> (p_instance=0x5b302ccb2cb0,
p_method=(void (Window::*)(class Window * const, const class Ref<InputEvent> &)) 0x5b2fefc36610 <Window::_window_input(Ref<InputEvent> const&)>, p_args=0x7ffe2de51410, r_error=...) at ./core/variant/binder_common.h:224
#56 0x00005b2fefc5a349 in call_with_variant_args<Window, Ref<InputEvent> const&> (p_instance=0x5b302ccb2cb0,
p_method=(void (Window::*)(class Window * const, const class Ref<InputEvent> &)) 0x5b2fefc36610 <Window::_window_input(Ref<InputEvent> const&)>, p_args=0x7ffe2de51410, p_argcount=1, r_error=...) at ./core/variant/binder_common.h:338
#57 0x00005b2fefc5a218 in CallableCustomMethodPointer<Window, void, Ref<InputEvent> const&>::call (this=0x5b30342a89d0, p_arguments=0x7ffe2de51410, p_argcount=1, r_return_value=..., r_call_error=...)
at ./core/object/callable_method_pointer.h:103
#58 0x00005b2ff1fd0026 in Callable::callp (this=0x7ffe2de51568, p_arguments=0x7ffe2de51410, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable.cpp:57
#59 0x00005b2febd97a81 in Callable::call<Ref<InputEvent> > (this=0x7ffe2de51568, p_args=...) at ./core/variant/variant.h:950
#60 0x00005b2febd88245 in DisplayServerX11::_dispatch_input_event (this=0x5b301dde4610, p_event=...) at platform/linuxbsd/x11/display_server_x11.cpp:4473
#61 0x00005b2febd8800d in DisplayServerX11::_dispatch_input_events (p_event=...) at platform/linuxbsd/x11/display_server_x11.cpp:4449
#62 0x00005b2ff1f6452e in Input::_parse_input_event_impl (this=0x5b301dcd6210, p_event=..., p_is_emulated=false) at core/input/input.cpp:986
#63 0x00005b2ff1f611d6 in Input::flush_buffered_events (this=0x5b301dcd6210) at core/input/input.cpp:1291
#64 0x00005b2febd8c9b8 in DisplayServerX11::process_events (this=0x5b301dde4610) at platform/linuxbsd/x11/display_server_x11.cpp:5611
#65 0x00005b2febd5bf6c in OS_LinuxBSD::run (this=0x7ffe2de52600) at platform/linuxbsd/os_linuxbsd.cpp:988
#66 0x00005b2febd724ff in main (argc=4, argv=0x7ffe2de52c48) at platform/linuxbsd/godot_linuxbsd.cpp:121
The editor should not be notified when ERR_PRINT is used in a child process.
https://github.com/godotengine/godot/blob/78d91947f689ea9eb4049f4d6371c0dfcfa0e62f/drivers/unix/os_unix.cpp#L934-L936
https://github.com/godotengine/godot/blob/78d91947f689ea9eb4049f4d6371c0dfcfa0e62f/core/error/error_macros.cpp#L126-L130
https://github.com/godotengine/godot/blob/78d91947f689ea9eb4049f4d6371c0dfcfa0e62f/editor/editor_log.cpp#L51
This might be related to EditorLog::_error_handler() ignoring p_editor_notify. When p_editor_notify is false, should it return immediately?
https://github.com/godotengine/godot/blob/78d91947f689ea9eb4049f4d6371c0dfcfa0e62f/core/error/error_macros.h#L671-L678
- Error messages in child processes that fail to execute external commands are printed using
ERR_PRINT; ERR_PRINTrenders error messages in Output (what's the difference between this andERR_PRINT_ED?);- #106164 refactored
EditorBottomPanelintoTabContainer, with error and warning icons set as tab icons; - After setting the tab icon,
get_local_mouse_position()is called when updating the cache.
Does #113692 fix it?
Does #113692 fix it?
Godot Engine v4.6.dev.mono.gh-113692.04f0db7ce (2025-12-06 20:21:41 UTC) - https://godotengine.org
Vulkan 1.4.305 - Forward+ - Using Device #0: AMD - AMD Radeon 780M Graphics (RADV PHOENIX)
gio: file:///home/bee/code/godot/mrp/a: 无法将文件 /home/bee/code/godot/mrp/a 丢到回收站:权限不够
ERROR: Could not create child process: kioclient5
at: execute (drivers/unix/os_unix.cpp:936)
GDScript backtrace (most recent call first):
[0] _run (res://new_script.gd:9)
Fatal error. Invalid Program: attempted to call a UnmanagedCallersOnly method from managed code.
mv: 无法将 '/home/bee/code/godot/mrp/a.1' 移动至 '/home/bee/.local/share/Trash/files/a.1': 权限不够
Fatal error. Invalid Program: attempted to call a UnmanagedCallersOnly method from managed code.
段错误 (核心已转储)
The build downloaded from https://github.com/godotengine/godot/pull/113692/checks still crashes (This might be a separate issue). The version built using scons does not crash.
Additionally, it's worth noting that the editor built from master will not crash if the Output contains icons that have been changed.
printerr("err")
OS.move_to_trash(ProjectSettings.globalize_path("res://a/"))