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 opening and closing immediately project #37665

Closed
Tracked by #37734
qarmin opened this issue Apr 7, 2020 · 5 comments
Closed
Tracked by #37734

Editor crash when opening and closing immediately project #37665

qarmin opened this issue Apr 7, 2020 · 5 comments

Comments

@qarmin
Copy link
Contributor

qarmin commented Apr 7, 2020

Godot version:
4.0.dev.custom_build.1222541c9

OS/device including version:
Ubuntu 19.10

Issue description:
When I open minimal and close project with command godot -e --quit, then editor crash with this backtrace

scene/gui/control.cpp:850:57: runtime error: member access within null pointer of type 'const struct Control'
scene/gui/control.cpp:850:57: runtime error: member call on null pointer of type 'const struct Object'
scene/gui/control.cpp:850:57: runtime error: member access within null pointer of type 'const struct Control'
scene/gui/control.cpp:850:57: runtime error: member access within null pointer of type 'const struct Control'
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] bin/godot.linuxbsd.tools.64s() [0x1755a1a] (/mnt/KubuntuWolne/mojgodot/platform/linuxbsd/crash_handler_linuxbsd.cpp:54)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46470) [0x7ff05164e470] (??:0)
[3] Control::get_theme_icon(StringName const&, StringName const&) const (/mnt/KubuntuWolne/mojgodot/scene/gui/control.cpp:850 (discriminator 4))
[4] EditorResourcePreview::_generate_preview(Ref<ImageTexture>&, Ref<ImageTexture>&, EditorResourcePreview::QueueItem const&, String const&) (/mnt/KubuntuWolne/mojgodot/editor/editor_resource_preview.cpp:171 (discriminator 6))
[5] EditorResourcePreview::_thread() (/mnt/KubuntuWolne/mojgodot/editor/editor_resource_preview.cpp:269)
[6] EditorResourcePreview::_thread_func(void*) (/mnt/KubuntuWolne/mojgodot/editor/editor_resource_preview.cpp:108)
[7] ThreadPosix::thread_callback(void*) (/mnt/KubuntuWolne/mojgodot/drivers/unix/thread_posix.cpp:76)
[8] /lib/x86_64-linux-gnu/libpthread.so.0(+0x9669) [0x7ff0524c9669] (??:0)
[9] /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7ff05172a323] (??:0)

For now it may crash with a little different backtrace similar to #37655, until PR which will fix it will be merged.

Minimal reproduction project:
https://github.com/qarmin/The-worst-Godot-test-project/archive/master.zip

@qarmin
Copy link
Contributor Author

qarmin commented Apr 9, 2020

This patch fixes crash, but it seems to be only a workaround

diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 2a4300f833..9bda1c279c 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -168,6 +168,9 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<
                }
                r_texture = generated;
 
+               if (!EditorNode::get_singleton()->get_theme_base())
+                       return;
+
                int small_thumbnail_size = EditorNode::get_singleton()->get_theme_base()->get_theme_icon("Object", "EditorIcons")->get_width(); // Kind of a workaround to retrieve the default icon size
                small_thumbnail_size *= EDSCALE;
 

@reduz
Copy link
Member

reduz commented Jul 3, 2020

I can't reproduce the crash either on X11 or Windows, is it still a problem?

@qarmin
Copy link
Contributor Author

qarmin commented Jul 3, 2020

I can't check it now due to other recently introduced crash with LocalVector(caused due using null pointer to struct Scenario)

servers/rendering/rendering_server_scene.cpp:996:27: runtime error: member access within null pointer of type 'struct Scenario'
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] godot4s() [0x19daa60] (/mnt/Miecz/godot/platform/linuxbsd/crash_handler_linuxbsd.cpp:54)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f65a544a210] (??:0)
[3] LocalVector<RID, unsigned int, false>::push_back(RID) (/mnt/Miecz/godot/./core/local_vector.h:57)
[4] RenderingServerScene::_update_instance(RenderingServerScene::Instance*) (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:1000)
[5] RenderingServerScene::_update_dirty_instance(RenderingServerScene::Instance*) (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:2919)
[6] RenderingServerScene::update_dirty_instances() (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:2926)
[7] RenderingServerScene::free(RID) (/mnt/Miecz/godot/servers/rendering/rendering_server_scene.cpp:2954)
[8] RenderingServerRaster::free(RID) (/mnt/Miecz/godot/servers/rendering/rendering_server_raster.cpp:77)
[9] RenderingServerWrapMT::free(RID) (/mnt/Miecz/godot/servers/rendering/rendering_server_wrap_mt.h:663)
[10] Node3DEditor::_finish_grid() (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.cpp:5586 (discriminator 2))
[11] Node3DEditor::update_grid() (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.cpp:5592)
[12] Node3DEditorViewport::_update_camera(float) (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.cpp:356)
[13] Node3DEditorViewport::_notification(int) (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.cpp:2333)
[14] Node3DEditorViewport::_notificationv(int, bool) (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.h:179 (discriminator 14))
[15] Object::notification(int, bool) (/mnt/Miecz/godot/core/object.cpp:901)
[16] CanvasItem::_propagate_visibility_changed(bool) (/mnt/Miecz/godot/scene/main/canvas_item.cpp:364)
[17] CanvasItem::_propagate_visibility_changed(bool) (/mnt/Miecz/godot/scene/main/canvas_item.cpp:371 (discriminator 2))
[18] CanvasItem::_propagate_visibility_changed(bool) (/mnt/Miecz/godot/scene/main/canvas_item.cpp:371 (discriminator 2))
[19] CanvasItem::_propagate_visibility_changed(bool) (/mnt/Miecz/godot/scene/main/canvas_item.cpp:371 (discriminator 2))
[20] CanvasItem::_propagate_visibility_changed(bool) (/mnt/Miecz/godot/scene/main/canvas_item.cpp:371 (discriminator 2))
[21] CanvasItem::show() (/mnt/Miecz/godot/scene/main/canvas_item.cpp:395)
[22] Node3DEditorPlugin::make_visible(bool) (/mnt/Miecz/godot/editor/plugins/node_3d_editor_plugin.cpp:6395)
[23] EditorNode::_editor_select(int) (/mnt/Miecz/godot/editor/editor_node.cpp:2869)
[24] EditorNode::_notification(int) (/mnt/Miecz/godot/editor/editor_node.cpp:552)
[25] EditorNode::_notificationv(int, bool) (/mnt/Miecz/godot/editor/editor_node.h:91 (discriminator 14))
[26] Object::notification(int, bool) (/mnt/Miecz/godot/core/object.cpp:901)
[27] Node::_propagate_ready() (/mnt/Miecz/godot/scene/main/node.cpp:191)
[28] Node::_propagate_ready() (/mnt/Miecz/godot/scene/main/node.cpp:181 (discriminator 2))
[29] Node::_set_tree(SceneTree*) (/mnt/Miecz/godot/scene/main/node.cpp:2563)
[30] SceneTree::init() (/mnt/Miecz/godot/scene/main/scene_tree.cpp:404)
[31] OS_LinuxBSD::run() (/mnt/Miecz/godot/platform/linuxbsd/os_linuxbsd.cpp:233)
[32] godot4s(main+0x326) [0x19d882c] (/mnt/Miecz/godot/platform/linuxbsd/godot_linuxbsd.cpp:57)
[33] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f65a542b0b3] (??:0)
[34] godot4s(_start+0x2e) [0x19d844e] (??:?)

@qarmin
Copy link
Contributor Author

qarmin commented Jul 21, 2020

This also happens with Godot 3.2.3 beta 1

The best way to reproduce it is to clone godot-demo-project repo, and then open every single project inside editor:

DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/gui/translation"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/gui/rich_text_bbcode"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/plugins"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/mobile/multitouch_cubes"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/mobile/sensors"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/mobile/multitouch_view"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/mobile/android_iap"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/voxel"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/platformer"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/ik"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/physics_tests"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/material_testers"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/truck_town"
DRI_PRIME=0 godot -e -q --path "/home/rafal/Projekty Dzikie/godot-demo-projects/3d/kinematic_character"


@qarmin
Copy link
Contributor Author

qarmin commented Jul 13, 2021

Looks that this may be fixed already, since I didn't have any crashes recently(~1 year)

@qarmin qarmin closed this as completed Jul 13, 2021
@qarmin qarmin added this to the 3.3 milestone Jul 13, 2021
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