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

The editor crashes when a node is deleted #58860

Closed
Karmavil opened this issue Mar 7, 2022 · 9 comments
Closed

The editor crashes when a node is deleted #58860

Karmavil opened this issue Mar 7, 2022 · 9 comments

Comments

@Karmavil
Copy link
Contributor

Karmavil commented Mar 7, 2022

Godot version

v4.0.alpha.custom_build 92615be

System information

Debian GNU/Linux bookworm/sid 64-bit, NVIDIA GM206 [GeForce GTX 960] (driver v470.103.01)

Issue description

The editor crashes when trying to delete a node for target=debug and target=release_debug, platform=linuxbsd (detected)

I find quite difficult to identify not the cause but the reason why this generates an error (trying to understand what's going on):

ERROR: Method argument to Callable constructor must be a non-empty string
   at: Callable (core/variant/callable.cpp:275)

If I break at string_name.cpp:116 _data is dealing with the physics_process (??) and this output is shown before the Bug error from line 116:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  32735
  Current serial number in output stream:  32736

then

ERROR: BUG: Unreferenced static string to 0: physics_process

_data has 1 static_count and 0 refcount I guess that's the issue but again _data holds physics_process at that moment

Facts:

This error is triggered before the _delete_confirm is called. But I cannot understand what String is trying to remove because of that physics_process in the middle


TL;DR Maybe not related
I also have this Warning present when I run a project:

Godot Engine v4.0.alpha.custom_build.92615be68 - https://godotengine.org
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        terminator_CreateInstance: Failed to CreateInstance in ICD 3.  Skipping ICD.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 93825162091184
     at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:156)
Vulkan API 1.2.189 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 960

Similar to what is mentioned here 39620 but in my case I can see the window dialog title clearly.

And I can see that my code editor identify X11_ENABLED as not defined (maybe because of Wyland I really don't know) but the engine is constantly using the code from this files i.e. display_server_x11.cpp.
I think it makes sense because Godot uses X11 but I am not building for platform=server I'm building for "Automatically detected platform: linuxbsd" so that is just more code that I still don't understand why is there, parts of the engine..

Steps to reproduce

  • In the active scene of an existing project select any node (single, parent or root)
  • Delete the item using the context list (RMB) or with the Supr key.
  • The crash happens before any confirmation most of the times and the window dialog is completely black, but sometimes the editor remains active and the window is correctly displayed until you confirm or cancel the action, then it crashes.

Minimal reproduction project

No response

@elmordo
Copy link
Contributor

elmordo commented Mar 7, 2022

The bug seems to be somewhere in the delete confirmation dialog. When you use delete without confirm (Shift + Del), the editor doesn't crash.

Tested on v4.0.alpha.custom_build [2a67b09] (Solus Linux)

@Karmavil
Copy link
Contributor Author

Karmavil commented Mar 7, 2022

Nice workaround! Thanks 🏆 @elmordo

I tried the cut tool (without a real understand of the differences in the files) and it worked but the first time I tried this tool (cut and paste) I wasn't able to drag the nodes. Fortunately that happened just one time.

@akien-mga
Copy link
Member

I can't reproduce on Mageia 9 with KDE on X11. Which DE are you running, and is it running on X11 or Wayland?

@elmordo
Copy link
Contributor

elmordo commented Mar 8, 2022

Personally I use Gnome on X11 (Solus Linux). And it seems to be some kind of bug in thread synchronization or something. When I use debugger and strep line by line in code of scene_tree_dock.cpp, responsible for setup and popup dialog (lines from 843 to 852 in the revision e6f00a0):

    delete_dialog->set_text(msg);
    
    // Resize the dialog to its minimum size.
    // This prevents the dialog from being too wide after displaying
    // a deletion confirmation for a node with a long name.
    delete_dialog->reset_size();
    delete_dialog->popup_centered();
  }
} break;

the editor doesn't crash either.

@akien-mga
Copy link
Member

For the record, this is likely the same bug as #58886, I'm doing some debugging there.

@akien-mga
Copy link
Member

Closing as duplicate of #58886, this was the same bug.

@Karmavil
Copy link
Contributor Author

Karmavil commented Mar 8, 2022

Well, this issue born here #58588

At that point every interaction with a window dialog generated a crash.

Then code was merged and the problem was solved. However this issue remained.

I checked the SceneTreeDock but it looked more related to the dialog itself, like even an AcceptDialog failed.

I checked the Button class and I bumped into with the commit @Calinou pushed 58879. I tried but it didn't solve this issue specifically.

But I am happy someone found the problem because it was tricky. Good job everybody

I will review that issue more in detail, however I still have a question for @akien-mga:

Yes my distro is using Wayland but what's the matter? Godot will use X11 anyways right? We could leave that conversation for the chat nevertheless Wayland is not mentioned in the documentation at all

@Karmavil
Copy link
Contributor Author

Karmavil commented Mar 8, 2022

OK I found this comment you did in a discussion about that topic.. I will try
#576 (comment)

@akien-mga
Copy link
Member

akien-mga commented Mar 8, 2022

Well, this issue born here #58588

Yes, that's also the same issue. It was wrongly closed as solved back then.

All three issues were the same and have now been fixed by #58891.

For Wayland, it's not implemented yet. Godot's X11 DisplayServer works on Wayland DEs thanks to xwayland. There are various WIP PRs to implement a dedicated Wayland DisplayServer, this will be done eventually. But it's not related to that issue - it could have been, which is why I asked, but further debugging showed that it was not a factor (GNOME was).

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

No branches or pull requests

4 participants