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

Crash when the editor has Save on Focus Loss enabled ("Task 'save' already exists.") #78558

Open
lmomimi opened this issue Jun 22, 2023 · 3 comments

Comments

@lmomimi
Copy link

lmomimi commented Jun 22, 2023

Godot version

v4.0.3.stable.mono.official [5222a99]

System information

linux rtx 2060

Issue description

crash when set editor "Save on Focus Loss" On

Steps to reproduce

1.create a empty project
2. set editor "Save on Focus Loss" On in "Editor Settings"
3. create 2d or 3d empy scene
4. run, Crash

Minimal reproduction project

same, 4.1 beta 3

@Efimero
Copy link

Efimero commented Jul 16, 2023

confirming this still happens in 4.2
seems to be trying to start a save task every frame it's not in focus

@Calinou
Copy link
Member

Calinou commented Jul 16, 2023

I can confirm this on 4.2.dev 0f7625a (Linux). Backtrace:

#0  DirAccessUnix::change_dir (this=this@entry=0x7fff7fb1c600, p_dir=...) at drivers/unix/dir_access_unix.cpp:335
#1  0x0000000001e4ce17 in DirAccessUnix::DirAccessUnix (this=this@entry=0x7fff7fb1c600) at drivers/unix/dir_access_unix.cpp:504
#2  0x0000000001cbe373 in DirAccess::_create_builtin<DirAccessUnix> () at ./core/io/dir_access.h:75
#3  0x0000000004c08e12 in DirAccess::create (p_access=DirAccess::ACCESS_RESOURCES) at core/io/dir_access.cpp:310
#4  0x0000000004c09525 in DirAccess::create_for_path (p_path=...) at core/io/dir_access.cpp:230
#5  0x0000000004c09d94 in DirAccess::exists (p_dir=...) at core/io/dir_access.cpp:485
#6  0x0000000001fc4d32 in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=3, p_confirmed=<optimized out>) at editor/editor_node.cpp:2554
#7  0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#8  0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#9  0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#10 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#11 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#12 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#13 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#14 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff8003f8) at editor/editor_node.h:951
#15 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#16 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#17 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#18 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#19 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#20 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#21 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#22 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#23 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#24 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff800968) at editor/editor_node.h:951
#25 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#26 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#27 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#28 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#29 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#30 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#31 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#32 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#33 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#34 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff800ed8) at editor/editor_node.h:951
#35 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#36 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#37 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#38 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#39 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#40 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#41 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#42 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#43 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#44 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff801448) at editor/editor_node.h:951
#45 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#46 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#47 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#48 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#49 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#50 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#51 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#52 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#53 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#54 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff8019b8) at editor/editor_node.h:951
#55 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#56 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#57 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#58 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#59 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#60 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#61 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#62 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#63 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#64 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff801f28) at editor/editor_node.h:951
#65 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#66 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#67 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#68 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#69 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#70 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#71 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#72 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
#73 0x00000000021f0512 in ProgressDialog::task_step (this=<optimized out>, p_task=..., p_state=..., p_step=0, p_force_redraw=<optimized out>) at ./servers/display_server.h:49
#74 0x0000000001fb1baf in EditorProgress::step (p_force_refresh=true, p_step=0, p_state=..., this=0x7fffff802498) at editor/editor_node.h:951
#75 EditorNode::_save_scene_with_preview (this=this@entry=0xdb5ac40, p_file=..., p_idx=p_idx@entry=-1) at editor/editor_node.cpp:1590
#76 0x0000000001fc4d8b in EditorNode::_menu_option_confirm (this=0xdb5ac40, p_option=<optimized out>, p_confirmed=<optimized out>) at editor/editor_node.cpp:2556
#77 0x0000000001fc9fc7 in EditorNode::_notification (this=0xdb5ac40, p_what=<optimized out>) at editor/editor_node.cpp:697
#78 0x00000000050831b4 in Object::notification (this=0xdb5ac40, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#79 0x0000000002fbd09f in Node::propagate_notification (this=0xdb5ac40, p_notification=p_notification@entry=2017) at scene/main/node.cpp:2210
#80 0x0000000002fbd0b7 in Node::propagate_notification (this=0xdaee390, p_notification=2017) at scene/main/node.cpp:2213
#81 0x00000000050831b4 in Object::notification (this=0xdaedea0, p_notification=2017, p_reversed=<optimized out>) at core/object/object.cpp:796
#82 0x0000000000abbbd2 in DisplayServerX11::process_events (this=0x875fa70) at platform/linuxbsd/x11/display_server_x11.cpp:4005
[... continues endlessly ...]

This is also spammed in stderr:

ERROR: Task 'save' already exists.
   at: add_task (editor/progress_dialog.cpp:160)

@Drathal
Copy link

Drathal commented Sep 21, 2023

Just want to add:

On running a scene I get this error, but no crash:

Parent node is busy setting up children, 'add_child()' failed. Consider using 'add_child.call_deferred(child)' instead. scene/main/window.cpp:1638 - Condition "!is_inside_tree()" is true.

es27XTyhbr

Disable save on focus loss helps getting rid of that error. Took me a while figuring this out.

Godot version: 4.2-dev5
System: Windows 11

@Calinou Calinou changed the title crash when set editor "Save on Focus Loss" On Crash when the editor has Save on Focus Loss enabled ("Task 'save' already exists.") Oct 11, 2023
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

5 participants