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 opening editor to project with autoload containing local-to-scene ShaderMaterial #92094

Closed
romlok opened this issue May 18, 2024 · 3 comments · Fixed by #92145
Closed

Comments

@romlok
Copy link
Contributor

romlok commented May 18, 2024

Tested versions

  • Reproducible in: v4.3.beta.custom_build (f58a96c)
  • Reproducible in: v4.3.dev6.official (64520fe)
  • Not reproducible in: v4.2.2.stable.official [15073af]

System information

Debian GNU/Linux trixie/sid trixie - Wayland - Vulkan (Mobile) - dedicated AMD Radeon RX 7600 (RADV NAVI33) () - AMD Ryzen 5 7600 6-Core Processor (12 Threads)

Issue description

I tried opening my current 4.2 project in the 4.3 dev6 snapshot (to see if a different bug had been fixed), and the editor crashed while the window was still at the splash screen.
I compiled the latest master to get debug symbols, and got this output:

$ ~/src/godot/engine/bin/godot.linuxbsd.editor.dev.x86_64 ./project.godot 
Godot Engine v4.3.beta.custom_build.f58a96cfa (2024-05-18 15:41:48 UTC) - https://godotengine.org
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_virtio.so. Skipping this driver.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 94860082383440
     at: _debug_messenger_callback (drivers/vulkan/rendering_context_driver_vulkan.cpp:301)
Vulkan 1.3.267 - Forward Mobile - Using Device #0: AMD - AMD Radeon RX 7600 (RADV NAVI33)


================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta.custom_build (f58a96cfa20530268a9b35efc8cd7ddad1900a8b)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3c510) [0x7f2ea2765510] (??:0)
[2] HashMap<String, DocData::ClassDoc, HashMapHasherDefault, HashMapComparatorDefault<String>, DefaultTypedAllocator<HashMapElement<String, DocData::ClassDoc> > >::_lookup_pos(String const&, unsigned int&) const (/home/mel/src/godot/engine/./core/templates/hash_map.h:100)
[3] HashMap<String, DocData::ClassDoc, HashMapHasherDefault, HashMapComparatorDefault<String>, DefaultTypedAllocator<HashMapElement<String, DocData::ClassDoc> > >::operator[](String const&) (/home/mel/src/godot/engine/./core/templates/hash_map.h:544)
[4] DocTools::add_doc(DocData::ClassDoc const&) (/home/mel/src/godot/engine/editor/doc_tools.cpp:371)
[5] Shader::get_shader_uniform_list(List<PropertyInfo, DefaultAllocator>*, bool) const (/home/mel/src/godot/engine/scene/resources/shader.cpp:180)
[6] ShaderMaterial::_get_property_list(List<PropertyInfo, DefaultAllocator>*) const (/home/mel/src/godot/engine/scene/resources/material.cpp:234)
[7] ShaderMaterial::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const (/home/mel/src/godot/engine/scene/resources/material.h:95 (discriminator 17))
[8] Object::get_property_list(List<PropertyInfo, DefaultAllocator>*, bool) const (/home/mel/src/godot/engine/core/object/object.cpp:524)
[9] Resource::duplicate_for_local_scene(Node*, HashMap<Ref<Resource>, Ref<Resource>, HashMapHasherDefault, HashMapComparatorDefault<Ref<Resource> >, DefaultTypedAllocator<HashMapElement<Ref<Resource>, Ref<Resource> > > >&) (/home/mel/src/godot/engine/core/io/resource.cpp:287)
[10] SceneState::make_local_resource(Variant&, SceneState::NodeData const&, HashMap<Ref<Resource>, Ref<Resource>, HashMapHasherDefault, HashMapComparatorDefault<Ref<Resource> >, DefaultTypedAllocator<HashMapElement<Ref<Resource>, Ref<Resource> > > >&, Node*, StringName, HashMap<Ref<Resource>, Ref<Resource>, HashMapHasherDefault, HashMapComparatorDefault<Ref<Resource> >, DefaultTypedAllocator<HashMapElement<Ref<Resource>, Ref<Resource> > > >&, int, Node**, SceneState::GenEditState) const (/home/mel/src/godot/engine/scene/resources/packed_scene.cpp:619)
[11] SceneState::instantiate(SceneState::GenEditState) const (/home/mel/src/godot/engine/scene/resources/packed_scene.cpp:359 (discriminator 1))
[12] PackedScene::instantiate(PackedScene::GenEditState) const (/home/mel/src/godot/engine/scene/resources/packed_scene.cpp:2083 (discriminator 1))
[13] SceneState::instantiate(SceneState::GenEditState) const (/home/mel/src/godot/engine/scene/resources/packed_scene.cpp:232 (discriminator 2))
[14] PackedScene::instantiate(PackedScene::GenEditState) const (/home/mel/src/godot/engine/scene/resources/packed_scene.cpp:2083 (discriminator 1))
[15] EditorAutoloadSettings::_create_autoload(String const&) (/home/mel/src/godot/engine/editor/editor_autoload_settings.cpp:414 (discriminator 1))
[16] EditorAutoloadSettings::EditorAutoloadSettings() (/home/mel/src/godot/engine/editor/editor_autoload_settings.cpp:861)
[17] ProjectSettingsEditor::ProjectSettingsEditor(EditorData*) (/home/mel/src/godot/engine/editor/project_settings_editor.cpp:746 (discriminator 1))
[18] EditorNode::EditorNode() (/home/mel/src/godot/engine/editor/editor_node.cpp:6718 (discriminator 1))
[19] Main::start() (/home/mel/src/godot/engine/main/main.cpp:3678 (discriminator 1))
[20] /home/mel/src/godot/engine/bin/godot.linuxbsd.editor.dev.x86_64(main+0x147) [0x56464be94a50] (/home/mel/src/godot/engine/platform/linuxbsd/godot_linuxbsd.cpp:84 (discriminator 1))
[21] /lib/x86_64-linux-gnu/libc.so.6(+0x276ca) [0x7f2ea27506ca] (??:0)
[22] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f2ea2750785] (??:0)
[23] /home/mel/src/godot/engine/bin/godot.linuxbsd.editor.dev.x86_64(_start+0x21) [0x56464be94841] (??:?)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)

Steps to reproduce

I was able to deduce from the backtrace that this is triggered by having:

  1. An autoload;
  2. Containing a ShaderMaterial;
  3. Which has resource_local_to_scene = true.

To reproduce, simply attempt to open the MRP in 4.3!

Minimal reproduction project (MRP)

autoload-local-shader-crash.zip

@matheusmdx
Copy link
Contributor

Bisecting points to #90161 as the culprit:

image

Also, you can reproduce the crash without the node being an autoload too, but in this case the game will crash when you press the play button

@akien-mga
Copy link
Member

CC @magian1127 @godotengine/shaders

@jsjtxietian
Copy link
Contributor

Looks like doc init is later than the shader autoload:

autoload:

image

doc tool init:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Immediate Blocker
Development

Successfully merging a pull request may close this issue.

4 participants