godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.15k stars 20.21k forks source link

Crash in RenderingServerScene::_update_instance with a specific glTF file #39852

Closed fire closed 3 years ago

fire commented 4 years ago

Godot version: 8ce6c50ad

OS/device including version: Vulkan / Win10

Issue description: The engine crashed.

Please note that the stack track on debug is completely different from a release stacktrace.

CrashHandlerException: Program crashed
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] oidnUnmapBuffer
[1] oidnUnmapBuffer
[2] oidnUnmapBuffer
[3] oidnUnmapBuffer
[4] oidnUnmapBuffer
[5] oidnUnmapBuffer
[6] oidnUnmapBuffer
[7] oidnUnmapBuffer
[8] oidnUnmapBuffer
[10] oidnUnmapBuffer
[11] oidnUnmapBuffer
[12] oidnUnmapBuffer
[13] oidnUnmapBuffer
[14] oidnUnmapBuffer
[15] oidnUnmapBuffer
[16] oidnUnmapBuffer
[17] oidnUnmapBuffer
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] <couldn't map PC to fn name>
[23] oidnUnmapBuffer
[24] BaseThreadInitThunk
-- END OF BACKTRACE --

Steps to reproduce: Load project.

Minimal reproduction project: Includes blend file.

https://send.firefox.com/download/8c98595dabcf312a/#M7VdS4JUEQu4vZc1s5YBBw

fire commented 4 years ago

image

Opens in three.js

Chaosus commented 4 years ago

I don't have crash as of a4e200a47a151ed5ce1627a17ce694048987eadf, but, some new warnings printed out in the console window:

ERROR: 1 shaders of type GiShaderRD wGere never freed
odot E   at: ngiShaderRD::~ShaderRD (servers\rendering\rne v4.0.dev.custom_build.a4e200a47 asterizer_rd\shader_rd.cpp- h:ttps://godotengine.org
470)
ERROR: 1 shaders of type SdfgiIntegrateShaderRD were never freed
   at: ShaderRD::~ShaderRD (servers\rendering\rasterizer_rd\shader_rd.cpp:470)
ERROR: 1 shaders of type SdfgiDirectLightShaderRD were never freed
   at: ShaderRD::~ShaderRD (servers\rendering\rasterizer_rd\shader_rd.cpp:470)
ERROR: 1 shaders of type SdfgiDebugProbesShaderRD were never freed
   at: ShaderRD::~ShaderRD (servers\rendering\rasterizer_rd\shader_rd.cpp:470)
ERROR: 1 shaders of type SdfgiDebugShaderRD were never freed
   at: ShaderRD::~ShaderRD (servers\rendering\rasterizer_rd\shader_rd.cpp:470)
ERROR: 1 shaders of type SdfgiPreprocessShaderRD were never freed
   at: ShaderRD::~ShaderRD (servers\rendering\rasterizer_rd\shader_rd.cpp:470)
fire commented 4 years ago

Are you on Windows?

Chaosus commented 4 years ago

nvm, it's crash I just missed the attached project :S (and thought it's about the empty project)

qarmin commented 4 years ago

Backtrace from Ubuntu 20.04

servers/rendering/rendering_server_scene.cpp:996:27: runtime error: member access within null pointer of type 'struct Scenario'
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f20936d8210] (??:0)
[2] LocalVector<RID, unsigned int, false>::push_back(RID) (/mnt/Miecz/godot/./core/local_vector.h:57)
[3] RenderingServerScene::_update_instance(RenderingServerScene::Instance*) (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:1000)
[4] RenderingServerScene::_update_dirty_instance(RenderingServerScene::Instance*) (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:2919)
[5] RenderingServerScene::update_dirty_instances() (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:2926)
[6] RenderingServerScene::instance_geometry_get_shader_parameter_list(RID, List<PropertyInfo, DefaultAllocator>*) const (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:966)
[7] RenderingServerRaster::instance_geometry_get_shader_parameter_list(RID, List<PropertyInfo, DefaultAllocator>*) const (/mnt/Miecz/godot/servers/rendering/rendering_server_raster.h:639)
[8] RenderingServerWrapMT::instance_geometry_get_shader_parameter_list(RID, List<PropertyInfo, DefaultAllocator>*) const (/mnt/Miecz/godot/servers/rendering/rendering_server_wrap_mt.h:545)
[9] GeometryInstance3D::_get_property_list(List<PropertyInfo, DefaultAllocator>*) const (/mnt/Miecz/godot/scene/3d/visual_instance_3d.cpp:243)
[10] GeometryInstance3D::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const (/mnt/Miecz/godot/./scene/3d/visual_instance_3d.h:83 (discriminator 27))
[11] MeshInstance3D::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const (/mnt/Miecz/godot/scene/3d/mesh_instance_3d.h:40 (discriminator 3))
[12] Object::get_property_list(List<PropertyInfo, DefaultAllocator>*, bool) const (/mnt/Miecz/godot/core/object.cpp:616)
[13] ResourceImporterScene::_make_external_resources(Node*, String const&, bool, bool, bool, bool, bool, bool, bool, bool, Map<Ref<Animation>, Ref<Animation>, Comparator<Ref<Animation> >, DefaultAllocator>&, Map<Ref<Material>, Ref<Material>, Comparator<Ref<Material> >, DefaultAllocator>&, Map<Ref<ArrayMesh>, Ref<ArrayMesh>, Comparator<Ref<ArrayMesh> >, DefaultAllocator>&) (/mnt/Miecz/godot/editor/import/resource_importer_scene.cpp:983)
[14] ResourceImporterScene::_make_external_resources(Node*, String const&, bool, bool, bool, bool, bool, bool, bool, bool, Map<Ref<Animation>, Ref<Animation>, Comparator<Ref<Animation> >, DefaultAllocator>&, Map<Ref<Material>, Ref<Material>, Comparator<Ref<Material> >, DefaultAllocator>&, Map<Ref<ArrayMesh>, Ref<ArrayMesh>, Comparator<Ref<ArrayMesh> >, DefaultAllocator>&) (/mnt/Miecz/godot/editor/import/resource_importer_scene.cpp:1093 (discriminator 1))
[15] ResourceImporterScene::import(String const&, String const&, Map<StringName, Variant, Comparator<StringName>, DefaultAllocator> const&, List<String, DefaultAllocator>*, List<String, DefaultAllocator>*, Variant*) (/mnt/Miecz/godot/editor/import/resource_importer_scene.cpp:1496 (discriminator 5))
[16] EditorFileSystem::_reimport_file(String const&) (/mnt/Miecz/godot/editor/editor_file_system.cpp:1728)
[17] EditorFileSystem::reimport_files(Vector<String> const&) (/mnt/Miecz/godot/editor/editor_file_system.cpp:1914 (discriminator 3))
[18] EditorFileSystem::_update_scan_actions() (/mnt/Miecz/godot/editor/editor_file_system.cpp:560)
[19] EditorFileSystem::_notification(int) (/mnt/Miecz/godot/editor/editor_file_system.cpp:1122)
[20] EditorFileSystem::_notificationv(int, bool) (/mnt/Miecz/godot/editor/editor_file_system.h:106 (discriminator 14))
[21] Object::notification(int, bool) (/mnt/Miecz/godot/core/object.cpp:901)
[22] SceneTree::_notify_group_pause(StringName const&, int) (/mnt/Miecz/godot/scene/main/scene_tree.cpp:824)
[23] SceneTree::idle(float) (/mnt/Miecz/godot/scene/main/scene_tree.cpp:455 (discriminator 2))
[24] Main::iteration() (/mnt/Miecz/godot/main/main.cpp:2207)
[25] OS_LinuxBSD::run() (/mnt/Miecz/godot/platform/linuxbsd/os_linuxbsd.cpp:241)
[26] godot4(main+0x125) [0x19a9eeb] (/mnt/Miecz/godot/platform/linuxbsd/godot_linuxbsd.cpp:57)
[27] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f20936b90b3] (??:0)
[28] godot4(_start+0x2e) [0x19a9d0e] (??:?)

Edit: This happens with a little different backtrace with a lot of other projects

JohanAR commented 4 years ago

Similar crash when trying to run a test scene I created in godot 4, also Ubuntu 20.04. Happens when I close the window

handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fcb5bbfa210] (??:0)
[2] LocalVector<RID, unsigned int, false>::find(RID const&, unsigned int) const (/mnt/newstore/Programs/godot4/./core/local_vector.h:168 (discriminator 1))
[3] LocalVector<RID, unsigned int, false>::erase(RID const&) (/mnt/newstore/Programs/godot4/./core/local_vector.h:86)
[4] RenderingServerScene::instance_set_base(RID, RID) (/mnt/newstore/Programs/godot4/servers/rendering/rendering_server_scene.cpp:378)
[5] RenderingServerRaster::instance_set_base(RID, RID) (/mnt/newstore/Programs/godot4/servers/rendering/rendering_server_raster.h:607)
[6] RenderingServerWrapMT::instance_set_base(RID, RID) (/mnt/newstore/Programs/godot4/servers/rendering/rendering_server_wrap_mt.h:513)
[7] Light3D::~Light3D() (/mnt/newstore/Programs/godot4/scene/3d/light_3d.cpp:360)
[8] OmniLight3D::~OmniLight3D() (/mnt/newstore/Programs/godot4/scene/3d/light_3d.h:180)
[9] void memdelete<Node>(Node*) (/mnt/newstore/Programs/godot4/./core/os/memory.h:118)
[10] Node::_notification(int) (/mnt/newstore/Programs/godot4/scene/main/node.cpp:168)
[11] Node::_notificationv(int, bool) (/mnt/newstore/Programs/godot4/./scene/main/node.h:46 (discriminator 14))
[12] Node3D::_notificationv(int, bool) (/mnt/newstore/Programs/godot4/./scene/3d/node_3d.h:52)
[13] Object::notification(int, bool) (/mnt/newstore/Programs/godot4/core/object.cpp:901)
[14] Object::_predelete() (/mnt/newstore/Programs/godot4/core/object.cpp:355)
[15] predelete_handler(Object*) (/mnt/newstore/Programs/godot4/core/object.cpp:1928)
[16] void memdelete<Node>(Node*) (/mnt/newstore/Programs/godot4/./core/os/memory.h:111)
[17] Node::_notification(int) (/mnt/newstore/Programs/godot4/scene/main/node.cpp:168)
[18] Node::_notificationv(int, bool) (/mnt/newstore/Programs/godot4/./scene/main/node.h:46 (discriminator 14))
[19] Viewport::_notificationv(int, bool) (/mnt/newstore/Programs/godot4/./scene/main/viewport.h:87)
[20] Window::_notificationv(int, bool) (/mnt/newstore/Programs/godot4/./scene/main/window.h:40)
[21] Object::notification(int, bool) (/mnt/newstore/Programs/godot4/core/object.cpp:901)
[22] Object::_predelete() (/mnt/newstore/Programs/godot4/core/object.cpp:355)
[23] predelete_handler(Object*) (/mnt/newstore/Programs/godot4/core/object.cpp:1928)
[24] void memdelete<Window>(Window*) (/mnt/newstore/Programs/godot4/./core/os/memory.h:111)
[25] SceneTree::finish() (/mnt/newstore/Programs/godot4/scene/main/scene_tree.cpp:540)
[26] OS_LinuxBSD::run() (/mnt/newstore/Programs/godot4/platform/linuxbsd/os_linuxbsd.cpp:246)
[27] /mnt/newstore/Programs/godot4/bin/godot.linuxbsd.tools.64(main+0x125) [0x199a87b] (/mnt/newstore/Programs/godot4/platform/linuxbsd/godot_linuxbsd.cpp:57)
[28] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fcb5bbdb0b3] (??:0)
[29] /mnt/newstore/Programs/godot4/bin/godot.linuxbsd.tools.64(_start+0x2e) [0x199a69e] (??:?)
-- END OF BACKTRACE --
akien-mga commented 4 years ago

OP's stacktrace is a crash in oidn (OpenImageDenoise). Please make a debug build to provide a stacktrace with debug symbols.

@qarmin @JohanAR Your stacktraces seem to be unrelated to the issue in the OP, please open new bug reports with a reproduction project.

fire commented 4 years ago

Here is my debug crash stack.

>   godot.windows.tools.64.exe!LocalVector<RID,unsigned int,0>::push_back(RID p_elem) Line 57   C++
    godot.windows.tools.64.exe!RenderingServerScene::_update_instance(RenderingServerScene::Instance * p_instance) Line 1000    C++
    godot.windows.tools.64.exe!RenderingServerScene::_update_dirty_instance(RenderingServerScene::Instance * p_instance) Line 2919  C++
    godot.windows.tools.64.exe!RenderingServerScene::update_dirty_instances() Line 2928 C++
    godot.windows.tools.64.exe!RenderingServerScene::instance_geometry_get_shader_parameter_list(RID p_instance, List<PropertyInfo,DefaultAllocator> * p_parameters) Line 966   C++
    godot.windows.tools.64.exe!RenderingServerRaster::instance_geometry_get_shader_parameter_list(RID arg1, List<PropertyInfo,DefaultAllocator> * arg2) Line 639    C++
    godot.windows.tools.64.exe!RenderingServerWrapMT::instance_geometry_get_shader_parameter_list(RID p1, List<PropertyInfo,DefaultAllocator> * p2) Line 545    C++
    godot.windows.tools.64.exe!GeometryInstance3D::_get_property_list(List<PropertyInfo,DefaultAllocator> * p_list) Line 243    C++
    godot.windows.tools.64.exe!GeometryInstance3D::_get_property_listv(List<PropertyInfo,DefaultAllocator> * p_list, bool p_reversed) Line 83   C++
    godot.windows.tools.64.exe!MeshInstance3D::_get_property_listv(List<PropertyInfo,DefaultAllocator> * p_list, bool p_reversed) Line 40   C++
    godot.windows.tools.64.exe!Object::get_property_list(List<PropertyInfo,DefaultAllocator> * p_list, bool p_reversed) Line 616    C++
    godot.windows.tools.64.exe!ResourceImporterScene::_make_external_resources(Node * p_node, const String & p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map<Ref<Animation>,Ref<Animation>,Comparator<Ref<Animation>>,DefaultAllocator> & p_animations, Map<Ref<Material>,Ref<Material>,Comparator<Ref<Material>>,DefaultAllocator> & p_materials, Map<Ref<ArrayMesh>,Ref<ArrayMesh>,Comparator<Ref<ArrayMesh>>,DefaultAllocator> & p_meshes) Line 983   C++
    godot.windows.tools.64.exe!ResourceImporterScene::_make_external_resources(Node * p_node, const String & p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map<Ref<Animation>,Ref<Animation>,Comparator<Ref<Animation>>,DefaultAllocator> & p_animations, Map<Ref<Material>,Ref<Material>,Comparator<Ref<Material>>,DefaultAllocator> & p_materials, Map<Ref<ArrayMesh>,Ref<ArrayMesh>,Comparator<Ref<ArrayMesh>>,DefaultAllocator> & p_meshes) Line 1094  C++
    godot.windows.tools.64.exe!ResourceImporterScene::import(const String & p_source_file, const String & p_save_path, const Map<StringName,Variant,Comparator<StringName>,DefaultAllocator> & p_options, List<String,DefaultAllocator> * r_platform_variants, List<String,DefaultAllocator> * r_gen_files, Variant * r_metadata) Line 1496 C++
    godot.windows.tools.64.exe!EditorFileSystem::_reimport_file(const String & p_file) Line 1728    C++
    godot.windows.tools.64.exe!EditorFileSystem::reimport_files(const Vector<String> & p_files) Line 1917   C++
    godot.windows.tools.64.exe!EditorFileSystem::_update_scan_actions() Line 560    C++
    godot.windows.tools.64.exe!EditorFileSystem::_notification(int p_what) Line 1122    C++
    godot.windows.tools.64.exe!EditorFileSystem::_notificationv(int p_notification, bool p_reversed) Line 106   C++
    godot.windows.tools.64.exe!Object::notification(int p_notification, bool p_reversed) Line 901   C++
    godot.windows.tools.64.exe!SceneTree::_notify_group_pause(const StringName & p_group, int p_notification) Line 826  C++
    godot.windows.tools.64.exe!SceneTree::idle(float p_time) Line 455   C++
    godot.windows.tools.64.exe!Main::iteration() Line 2207  C++
    godot.windows.tools.64.exe!OS_Windows::run() Line 627   C++
    godot.windows.tools.64.exe!widechar_main(int argc, wchar_t * * argv) Line 161   C++
    godot.windows.tools.64.exe!_main() Line 183 C++
    godot.windows.tools.64.exe!main(int _argc, char * * _argv) Line 195 C++
akien-mga commented 4 years ago

I'm confused by the oidnUnmapBuffer in the original stacktrace which is not found in the version with debug symbols, but let's focus on fixing the RenderingServerScene::_update_instance crash found by @fire and @qarmin then. Only @JohanAR's stacktrace would need a dedicated report with reproducer, as it might be a different bug.

fire commented 3 years ago

Since Firefox Send is gone the original scene is from https://www.blendswap.com/blend/5014.

fire commented 3 years ago

I can't crash the renderer as of 9f8a923 on Linux. It may still happen on Windows.

dsge commented 3 years ago

I can't crash the renderer as of 9f8a923 on Linux. It may still happen on Windows.

It's possible that this was also fixed by #40628 just like my issue (#40395) was.