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

Editor crash when selecting a node with a built-in script #40117

Closed
KoBeWi opened this issue Jul 4, 2020 · 3 comments · Fixed by #40145
Closed

Editor crash when selecting a node with a built-in script #40117

KoBeWi opened this issue Jul 4, 2020 · 3 comments · Fixed by #40145

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Jul 4, 2020

Godot version:

8ccb1ce

Issue description:

This started happening in my test project on newest master:

CrashHandlerException: Program crashed
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] EditorInspector::_update_script_class_properties (x:\inne\godot\source\godot\editor\editor_inspector.cpp:2441)
[1] EditorInspector::update_tree (x:\inne\godot\source\godot\editor\editor_inspector.cpp:1511)
[2] EditorInspector::edit (x:\inne\godot\source\godot\editor\editor_inspector.cpp:1951)
[3] EditorNode::_edit_current (x:\inne\godot\source\godot\editor\editor_node.cpp:1898)
[4] EditorNode::push_item (x:\inne\godot\source\godot\editor\editor_node.cpp:1802)
[5] EditorNode::load_scene (x:\inne\godot\source\godot\editor\editor_node.cpp:3420)
[6] EditorNode::_load_open_scenes_from_config (x:\inne\godot\source\godot\editor\editor_node.cpp:4470)
[7] EditorNode::_load_docks (x:\inne\godot\source\godot\editor\editor_node.cpp:4265)
[8] EditorNode::_sources_changed (x:\inne\godot\source\godot\editor\editor_node.cpp:836)
[9] call_with_variant_args_helper<EditorNode,bool,0> (x:\inne\godot\source\godot\core\callable_method_pointer.h:136)
[10] call_with_variant_args<EditorNode,bool> (x:\inne\godot\source\godot\core\callable_method_pointer.h:158)
[11] CallableCustomMethodPointer<EditorNode,bool>::call (x:\inne\godot\source\godot\core\callable_method_pointer.h:185)
[12] Callable::call (x:\inne\godot\source\godot\core\callable.cpp:50)
[13] Object::emit_signal (x:\inne\godot\source\godot\core\object.cpp:1170)
[14] Object::emit_signal (x:\inne\godot\source\godot\core\object.cpp:1225)
[15] EditorFileSystem::_notification (x:\inne\godot\source\godot\editor\editor_file_system.cpp:1123)
[16] EditorFileSystem::_notificationv (x:\inne\godot\source\godot\editor\editor_file_system.h:106)
[17] Object::notification (x:\inne\godot\source\godot\core\object.cpp:901)
[18] SceneTree::_notify_group_pause (x:\inne\godot\source\godot\scene\main\scene_tree.cpp:828)
[19] SceneTree::idle (x:\inne\godot\source\godot\scene\main\scene_tree.cpp:455)
[20] Main::iteration (x:\inne\godot\source\godot\main\main.cpp:2206)
[21] OS_Windows::run (x:\inne\godot\source\godot\platform\windows\os_windows.cpp:627)
[22] widechar_main (x:\inne\godot\source\godot\platform\windows\godot_windows.cpp:161)
[23] _main (x:\inne\godot\source\godot\platform\windows\godot_windows.cpp:183)
[24] main (x:\inne\godot\source\godot\platform\windows\godot_windows.cpp:195)
[25] __scrt_common_main_seh (f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283)
[26] BaseThreadInitThunk
-- END OF BACKTRACE --

I have yet to find out what exactly causes this. The project opens fine in 3.2.2.

Minimal reproduction project:

Coming soon (unless someone figures this out from the backtrace)

@akien-mga
Copy link
Member

Probably related to #32428, CC @willnationsdev.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 5, 2020

Turns out a reproduction project isn't necessary. The editor crashes as soon as you select a node with a script attached 🙃

@KoBeWi KoBeWi changed the title Crash when opening project Editor crash when selecting a node with a script Jul 5, 2020
@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 5, 2020

Ok, I know what happens. This is what causes crash:

Ref<Script> s = ResourceLoader::load(path, "Script");
List<PropertyInfo> props;
s->get_script_property_list(&props);

The script is loaded from a path, but when it's built-in, the loading fails because there's no path. Then a method is called on an invalid reference.

@KoBeWi KoBeWi changed the title Editor crash when selecting a node with a script Editor crash when selecting a node with a built-in script Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants