godotengine / godot

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

`SurfaceUpgradeTool::_show_popup` deadlock when loading project imported in 4.1 in 4.2 beta (self-contained editors) #84732

Closed akien-mga closed 12 months ago

akien-mga commented 1 year ago

Godot version

4.2.beta5, master (e38686f85b768a451dc06324fe2471adc8665448)

System information

Mageia 9 - Vulkan (Forward+) - dedicated AMD Radeon RX Vega M GL Graphics (RADV VEGAM) () - Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz (8 Threads)

Issue description

I noticed a deadlock in GDScriptCache::get_full_script when trying to open GDQuest's 3D TPS demo in 4.2 beta 5 and latest master (e38686f85b768a451dc06324fe2471adc8665448). I haven't yet tested earlier versions to see whether I can pinpoint a regression time, I'll do that next.

It happens when opening the project in Godot 4.2 after having opened it once in 4.1.3, ensuring that all files in .godot have been generated by 4.1.3.

The editor freezes, and attaching a debugger gives me this stacktrace of where it seems to be stuck, on a mutex in GDScriptCache::get_full_script:

(gdb) bt
#0  0x00007f4c8e85d97c in __lll_lock_wait () from /lib64/libc.so.6
#1  0x00007f4c8e86361f in pthread_mutex_lock@@GLIBC_2.2.5 () from /lib64/libc.so.6
#2  0x00000000056d59b7 in __gthread_mutex_lock (__mutex=0xbae97e8) at /usr/include/c++/12/x86_64-mageia-linux/bits/gthr-default.h:749
#3  0x00000000056d5a07 in __gthread_recursive_mutex_lock (__mutex=0xbae97e8) at /usr/include/c++/12/x86_64-mageia-linux/bits/gthr-default.h:811
#4  0x00000000056d5a3c in std::recursive_mutex::lock (this=0xbae97e8) at /usr/include/c++/12/mutex:108
#5  0x00000000056d6309 in std::unique_lock<std::recursive_mutex>::lock (this=0x7fff39a697a0) at /usr/include/c++/12/bits/unique_lock.h:139
#6  0x00000000056d61d7 in std::unique_lock<std::recursive_mutex>::unique_lock (this=0x7fff39a697a0, __m=...) at /usr/include/c++/12/bits/unique_lock.h:69
#7  0x0000000005f9324a in MutexLock<MutexImpl<std::recursive_mutex> >::MutexLock (p_mutex=..., this=<optimized out>) at ./core/os/mutex.h:122
#8  GDScriptCache::get_full_script (p_path=..., r_error=@0x7fff39a6982c: OK, p_owner=..., p_update_from_disk=false) at ./modules/gdscript/gdscript_cache.cpp:273
#9  0x0000000005f66dcf in ResourceFormatLoaderGDScript::load (this=0xbec68f0, p_path=..., p_original_path=..., r_error=0x221a1d6c, p_use_sub_threads=false, r_progress=0x221a1d60, 
    p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./modules/gdscript/gdscript.cpp:2699
#10 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x221a1d6c, p_use_sub_threads=false, r_progress=0x221a1d60)
    at ./core/io/resource_loader.cpp:261
#11 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x221a1d18) at ./core/io/resource_loader.cpp:319
#12 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE)
    at ./core/io/resource_loader.cpp:498
#13 0x00000000088c7ea5 in ResourceLoaderText::load (this=0x7fff39a6a560) at ./scene/resources/resource_format_text.cpp:467
#14 0x00000000088d3afd in ResourceFormatLoaderText::load (this=0xd591dd0, p_path=..., p_original_path=..., r_error=0x229f462c, p_use_sub_threads=false, r_progress=0x229f4620, 
    p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./scene/resources/resource_format_text.cpp:1651
#15 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x229f462c, p_use_sub_threads=false, r_progress=0x229f4620)
    at ./core/io/resource_loader.cpp:261
#16 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x229f45d8) at ./core/io/resource_loader.cpp:319
#17 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE)
    at ./core/io/resource_loader.cpp:498
#18 0x00000000088c7ea5 in ResourceLoaderText::load (this=0x7fff39a6d430) at ./scene/resources/resource_format_text.cpp:467
#19 0x00000000088d3afd in ResourceFormatLoaderText::load (this=0xd591dd0, p_path=..., p_original_path=..., r_error=0x23cdc08c, p_use_sub_threads=false, r_progress=0x23cdc080, 
    p_cache_mode=ResourceFormatLoader::CACHE_MODE_REPLACE) at ./scene/resources/resource_format_text.cpp:1651
#20 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REPLACE, r_error=0x23cdc08c, p_use_sub_threads=false, r_progress=0x23cdc080)
    at ./core/io/resource_loader.cpp:261
--Type <RET> for more, q to quit, c to continue without paging--
#21 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x23cdc038) at ./core/io/resource_loader.cpp:319
#22 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REPLACE)
    at ./core/io/resource_loader.cpp:498
#23 0x00000000099e5989 in ResourceLoader::load (p_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REPLACE, r_error=0x7fff39a6fae4) at ./core/io/resource_loader.cpp:415
#24 0x0000000007105359 in EditorNode::load_scene (this=0xe0d48a0, p_scene=..., p_ignore_broken_deps=false, p_set_inherited=false, p_clear_errors=true, p_force_open_imported=false, p_silent_change_tab=false)
    at ./editor/editor_node.cpp:3760
#25 0x0000000007111e3e in EditorNode::_load_open_scenes_from_config (this=0xe0d48a0, p_layout=...) at ./editor/editor_node.cpp:5466
#26 0x000000000710ee30 in EditorNode::_load_editor_layout (this=0xe0d48a0) at ./editor/editor_node.cpp:5090
#27 0x00000000070f05e0 in EditorNode::_sources_changed (this=0xe0d48a0, p_exist=false) at ./editor/editor_node.cpp:1049
#28 0x0000000007304085 in call_with_variant_args_helper<EditorNode, bool, 0ul> (p_instance=0xe0d48a0, p_method=(void (EditorNode::*)(EditorNode * const, bool)) 0x70f0526 <EditorNode::_sources_changed(bool)>, 
    p_args=0x7fff39a70480, r_error=...) at ./core/variant/binder_common.h:303
#29 0x00000000072f5101 in call_with_variant_args<EditorNode, bool> (p_instance=0xe0d48a0, p_method=(void (EditorNode::*)(EditorNode * const, bool)) 0x70f0526 <EditorNode::_sources_changed(bool)>, p_args=0x7fff39a70480, 
    p_argcount=1, r_error=...) at ./core/variant/binder_common.h:417
#30 0x00000000072e2542 in CallableCustomMethodPointer<EditorNode, bool>::call (this=0x1cf69270, p_arguments=0x7fff39a70480, p_argcount=1, r_return_value=..., r_call_error=...) at ./core/object/callable_method_pointer.h:104
#31 0x0000000009afe4e5 in Callable::callp (this=0x21f90c50, p_arguments=0x7fff39a70480, p_argcount=1, r_return_value=..., r_call_error=...) at ./core/variant/callable.cpp:57
#32 0x0000000009e112cc in Object::emit_signalp (this=0xe12b6a0, p_name=..., p_args=0x7fff39a70480, p_argcount=1) at ./core/object/object.cpp:1127
#33 0x0000000007dbc970 in Node::emit_signalp (this=0xe12b6a0, p_name=..., p_args=0x7fff39a70480, p_argcount=1) at ./scene/main/node.cpp:3606
#34 0x000000000659371c in Object::emit_signal<bool> (this=0xe12b6a0, p_name=...) at ./core/object/object.h:922
#35 0x0000000006f4f85b in EditorFileSystem::_notification (this=0xe12b6a0, p_what=17) at ./editor/editor_file_system.cpp:1285
#36 0x0000000006fe5178 in EditorFileSystem::_notificationv (this=0xe12b6a0, p_notification=17, p_reversed=false) at ./editor/editor_file_system.h:146
#37 0x0000000009e0f812 in Object::notification (this=0xe12b6a0, p_notification=17, p_reversed=false) at ./core/object/object.cpp:837
#38 0x0000000007dc1db0 in SceneTree::_process_group (this=0xe065140, p_group=0xe065398, p_physics=false) at ./scene/main/scene_tree.cpp:951
#39 0x0000000007dc2329 in SceneTree::_process (this=0xe065140, p_physics=false) at ./scene/main/scene_tree.cpp:1028
#40 0x0000000007dc0268 in SceneTree::process (this=0xe065140, p_time=0.077858000000000122) at ./scene/main/scene_tree.cpp:508
#41 0x0000000005754650 in Main::iteration () at main/main.cpp:3636
#42 0x00000000056cddce in OS_LinuxBSD::run (this=0x7fff39a70960) at platform/linuxbsd/os_linuxbsd.cpp:933
#43 0x00000000056c6840 in main (argc=2, argv=0x7fff39a70f48) at platform/linuxbsd/godot_linuxbsd.cpp:74

Steps to reproduce

Edit: See below, at least one of the two Godot versions must be self-contained to reproduce the issue.

Minimal reproduction project

Not really minimal, I haven't yet tried to narrow it down. But the stacktrace suggests an issue with GDScript, possibly preloading or cyclic references.

akien-mga commented 1 year ago

Did some more testing, I'm not sure anymore whether it's a regression, and it only seems to appear with a somewhat baroque setup.

My Godot 4.1.3 is used self-contained, so it doesn't share its editor data with my 4.2 snapshots / git builds, which are not self-contained and use the editor data installed in the default user folders (notably ~/.cache/godot for the cache).

This seems to be important, and the problem seems related to generating the .godot folder with the self-contained Godot 4.1.3, then opening the project in Godot 4.2 after having deleted ~/.cache/godot - can be done before importing in 4.1.3 or after, that doesn't seem to make a difference (which is logical as the self-contained 4.1.3 won't touch it).

akien-mga commented 1 year ago

So @YuriSizov and I did some digging, and the problem is indeed tied to using self-contained editors / separate editor caches in the migration from a .godot folder imported in 4.1.x to Godot 4.2.

Our friend SurfaceUpgradeTool seems to be involved, as one of the other waiting threads shows:

Thread 26 (Thread 0x7f8735ffc6c0 (LWP 182795) "godot.linuxbsd."):
#0  0x00007f87a555e756 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007f87a5560dc8 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00000000092164ee in Semaphore::wait (this=0xcc2b368) at ./core/os/semaphore.h:65
#3  CommandQueueMT::push_and_ret<RendererViewport, RID (RendererViewport::*)(RID) const, RID, RID> (this=0xcc2b358, p_instance=0xca121d0, p_method=(RID (RendererViewport::*)(const RendererViewport * const, RID)) 0x91638e0 <RendererViewport::viewport_get_texture(RID) const>, p1=..., r_ret=0x7f8735ff1458) at ./core/templates/command_queue_mt.h:396
#4  0x00000000091f6366 in RenderingServerDefault::viewport_get_texture (this=0xcc2b130, p1=...) at ./servers/rendering/rendering_server_default.h:622
#5  0x0000000007df5a00 in Viewport::Viewport (this=0x7f8724540af0) at ./scene/main/viewport.cpp:4790
#6  0x0000000007e16bb9 in Window::Window (this=0x7f8724540af0) at ./scene/main/window.cpp:2940
#7  0x0000000007f4de16 in AcceptDialog::AcceptDialog (this=0x7f8724540af0) at ./scene/gui/dialogs.cpp:402
#8  0x0000000007f4e6cb in ConfirmationDialog::ConfirmationDialog (this=0x7f8724540af0) at ./scene/gui/dialogs.cpp:460
#9  0x00000000071127be in EditorNode::immediate_confirmation_dialog (p_text=..., p_ok_text=..., p_cancel_text=..., p_wrap_width=500) at ./editor/editor_node.cpp:5539
#10 0x00000000073d2aa4 in SurfaceUpgradeTool::_show_popup (this=0xe585290) at ./editor/surface_upgrade_tool.cpp:84
#11 0x00000000073d290c in SurfaceUpgradeTool::_try_show_popup () at ./editor/surface_upgrade_tool.cpp:70
#12 0x0000000008d9d253 in RenderingServer::fix_surface_compatibility (this=0xcc2b130, p_surface=..., p_path=...) at ./servers/rendering_server.cpp:2135
#13 0x000000000885523a in ArrayMesh::_set_surfaces (this=0x7f87244795c0, p_surfaces=...) at ./scene/resources/mesh.cpp:1643
#14 0x0000000007ec3cdf in call_with_variant_args_helper<__UnexistingClass, Array const&, 0ul> (p_instance=0x7f87244795c0, p_method=(void (__UnexistingClass::*)(__UnexistingClass * const, const Array &)) 0x88542e8 <ArrayMesh::_set_surfaces(Array const&)>, p_args=0x7f8735ff2468, r_error=...) at ./core/variant/binder_common.h:303
#15 0x0000000007ea8ee6 in call_with_variant_args_dv<__UnexistingClass, Array const&> (p_instance=0x7f87244795c0, p_method=(void (__UnexistingClass::*)(__UnexistingClass * const, const Array &)) 0x88542e8 <ArrayMesh::_set_surfaces(Array const&)>, p_args=0x7f8735ff2508, p_argcount=1, r_error=..., default_values=...) at ./core/variant/binder_common.h:450
#16 0x0000000007e90602 in MethodBindT<Array const&>::call (this=0xdf9a400, p_object=0x7f87244795c0, p_args=0x7f8735ff2508, p_arg_count=1, r_error=...) at ./core/object/method_bind.h:335
#17 0x0000000009e04780 in ClassDB::set_property (p_object=0x7f87244795c0, p_property=..., p_value=..., r_valid=0x0) at ./core/object/class_db.cpp:1235
#18 0x0000000009e0d5ba in Object::set (this=0x7f87244795c0, p_name=..., p_value=..., r_valid=0x0) at ./core/object/object.cpp:257
#19 0x00000000099d4bfb in ResourceLoaderBinary::load (this=0x7f8735ff2960) at ./core/io/resource_format_binary.cpp:832
#20 0x00000000099d70a6 in ResourceFormatLoaderBinary::load (this=0xbe72f70, p_path=..., p_original_path=..., r_error=0x7f872407dd6c, p_use_sub_threads=false, r_progress=0x7f872407dd60, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./core/io/resource_format_binary.cpp:1196
#21 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x7f872407dd6c, p_use_sub_threads=false, r_progress=0x7f872407dd60) at ./core/io/resource_loader.cpp:261
--Type <RET> for more, q to quit, c to continue without paging--c
#22 0x00000000099e0f37 in ResourceFormatImporter::load (this=0xbe73270, p_path=..., p_original_path=..., r_error=0x7f872407dd6c, p_use_sub_threads=false, r_progress=0x7f872407dd60, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./core/io/resource_importer.cpp:139
#23 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x7f872407dd6c, p_use_sub_threads=false, r_progress=0x7f872407dd60) at ./core/io/resource_loader.cpp:261
#24 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x7f872407dd18) at ./core/io/resource_loader.cpp:319
#25 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./core/io/resource_loader.cpp:498
#26 0x00000000088c7ea5 in ResourceLoaderText::load (this=0x7f8735ff39b0) at ./scene/resources/resource_format_text.cpp:467
#27 0x00000000088d3afd in ResourceFormatLoaderText::load (this=0xcbfcf00, p_path=..., p_original_path=..., r_error=0x7f8724082ccc, p_use_sub_threads=false, r_progress=0x7f8724082cc0, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./scene/resources/resource_format_text.cpp:1651
#28 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x7f8724082ccc, p_use_sub_threads=false, r_progress=0x7f8724082cc0) at ./core/io/resource_loader.cpp:261
#29 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x7f8724082c78) at ./core/io/resource_loader.cpp:319
#30 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./core/io/resource_loader.cpp:498
#31 0x00000000088c7ea5 in ResourceLoaderText::load (this=0x7f8735ff6880) at ./scene/resources/resource_format_text.cpp:467
#32 0x00000000088d3afd in ResourceFormatLoaderText::load (this=0xcbfcf00, p_path=..., p_original_path=..., r_error=0x7f8724081bac, p_use_sub_threads=false, r_progress=0x7f8724081ba0, p_cache_mode=ResourceFormatLoader::CACHE_MODE_IGNORE) at ./scene/resources/resource_format_text.cpp:1651
#33 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_IGNORE, r_error=0x7f8724081bac, p_use_sub_threads=false, r_progress=0x7f8724081ba0) at ./core/io/resource_loader.cpp:261
#34 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x7f8724081b58) at ./core/io/resource_loader.cpp:319
#35 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_IGNORE) at ./core/io/resource_loader.cpp:498
#36 0x00000000099e5989 in ResourceLoader::load (p_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_IGNORE, r_error=0x0) at ./core/io/resource_loader.cpp:415
#37 0x0000000008882dc7 in PackedScene::reload_from_file (this=0x7f872506c4c0) at ./scene/resources/packed_scene.cpp:1921
#38 0x0000000005f93bd2 in GDScriptCache::get_packed_scene (p_path=..., r_error=@0x7f8735ff8fa4: OK, p_owner=...) at ./modules/gdscript/gdscript_cache.cpp:395
#39 0x0000000005f82225 in GDScriptAnalyzer::reduce_preload (this=0x7f8735ffab60, p_preload=0x7f87245c0620) at ./modules/gdscript/gdscript_analyzer.cpp:4158
#40 0x0000000005f76db4 in GDScriptAnalyzer::reduce_expression (this=0x7f8735ffab60, p_expression=0x7f87245c0620, p_is_root=false) at ./modules/gdscript/gdscript_analyzer.cpp:2466
#41 0x0000000005f7352c in GDScriptAnalyzer::resolve_assignable (this=0x7f8735ffab60, p_assignable=0x7f872419e830, p_kind=0x3bb7d02 "constant") at ./modules/gdscript/gdscript_analyzer.cpp:1890
#42 0x0000000005f741ee in GDScriptAnalyzer::resolve_constant (this=0x7f8735ffab60, p_constant=0x7f872419e830, p_is_local=false) at ./modules/gdscript/gdscript_analyzer.cpp:2003
#43 0x0000000005f6e03b in GDScriptAnalyzer::resolve_class_member (this=0x7f8735ffab60, p_class=0x7f87254d3a00, p_index=0, p_source=0x7f872419e830) at ./modules/gdscript/gdscript_analyzer.cpp:983
#44 0x0000000005f6f478 in GDScriptAnalyzer::resolve_class_interface (this=0x7f8735ffab60, p_class=0x7f87254d3a00, p_source=0x7f87254d3a00) at ./modules/gdscript/gdscript_analyzer.cpp:1185
#45 0x0000000005f6f649 in GDScriptAnalyzer::resolve_class_interface (this=0x7f8735ffab60, p_class=0x7f87254d3a00, p_recursive=true) at ./modules/gdscript/gdscript_analyzer.cpp:1213
#46 0x0000000005f89d03 in GDScriptAnalyzer::resolve_interface (this=0x7f8735ffab60) at ./modules/gdscript/gdscript_analyzer.cpp:5534
#47 0x0000000005f89f43 in GDScriptAnalyzer::analyze (this=0x7f8735ffab60) at ./modules/gdscript/gdscript_analyzer.cpp:5569
#48 0x0000000005f5a970 in GDScript::reload (this=0x7f8724016c00, p_keep_state=true) at ./modules/gdscript/gdscript.cpp:753
#49 0x0000000005f933ce in GDScriptCache::get_full_script (p_path=..., r_error=@0x7f8735ffb10c: OK, p_owner=..., p_update_from_disk=false) at ./modules/gdscript/gdscript_cache.cpp:303
#50 0x0000000005f66dcf in ResourceFormatLoaderGDScript::load (this=0xc35cb30, p_path=..., p_original_path=..., r_error=0x7f872452546c, p_use_sub_threads=false, r_progress=0x7f8724525460, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./modules/gdscript/gdscript.cpp:2699
#51 0x00000000099e4b2d in ResourceLoader::_load (p_path=..., p_original_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x7f872452546c, p_use_sub_threads=false, r_progress=0x7f8724525460) at ./core/io/resource_loader.cpp:261
#52 0x00000000099e524c in ResourceLoader::_thread_load_function (p_userdata=0x7f8724525418) at ./core/io/resource_loader.cpp:319
#53 0x00000000099e5e91 in ResourceLoader::_load_start (p_path=..., p_type_hint=..., p_thread_mode=ResourceLoader::LOAD_THREAD_FROM_CURRENT, p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE) at ./core/io/resource_loader.cpp:498
#54 0x00000000099e5989 in ResourceLoader::load (p_path=..., p_type_hint=..., p_cache_mode=ResourceFormatLoader::CACHE_MODE_REUSE, r_error=0x0) at ./core/io/resource_loader.cpp:415
#55 0x000000000745b0ff in EditorResourcePreviewGenerator::generate_from_path (this=0x1d32d870, p_path=..., p_size=..., p_metadata=...) at ./editor/editor_resource_preview.cpp:68
#56 0x000000000745bd1e in EditorResourcePreview::_generate_preview (this=0xf3560f0, r_texture=..., r_small_texture=..., p_item=..., cache_base=..., p_metadata=...) at ./editor/editor_resource_preview.cpp:159
#57 0x000000000745ca9a in EditorResourcePreview::_iterate (this=0xf3560f0) at ./editor/editor_resource_preview.cpp:250
#58 0x000000000745d528 in EditorResourcePreview::_thread (this=0xf3560f0) at ./editor/editor_resource_preview.cpp:337
#59 0x000000000745b6bc in EditorResourcePreview::_thread_func (ud=0xf3560f0) at ./editor/editor_resource_preview.cpp:102
#60 0x00000000098d89ae in Thread::callback (p_caller_id=23, p_settings=..., p_callback=0x745b69c <EditorResourcePreview::_thread_func(void*)>, p_userdata=0xf3560f0) at ./core/os/thread.cpp:61
#61 0x00000000098eb6f9 in std::__invoke_impl<void, void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> (__f=@0x21144868: 0x98d8920 <Thread::callback(unsigned long, Thread::Settings const&, void (*)(void*), void*)>) at /usr/include/c++/12/bits/invoke.h:61
#62 0x00000000098eb5c2 in std::__invoke<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> (__fn=@0x21144868: 0x98d8920 <Thread::callback(unsigned long, Thread::Settings const&, void (*)(void*), void*)>) at /usr/include/c++/12/bits/invoke.h:96
#63 0x00000000098eb47d in std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul> (this=0x21144848) at /usr/include/c++/12/bits/std_thread.h:279
#64 0x00000000098e9d50 in std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> >::operator() (this=0x21144848) at /usr/include/c++/12/bits/std_thread.h:286
#65 0x00000000098e8c02 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> > >::_M_run (this=0x21144840) at /usr/include/c++/12/bits/std_thread.h:231
#66 0x000000000a2b9193 in std::execute_native_thread_routine (__p=0x21144840) at ../../../../../libstdc++-v3/src/c++11/thread.cc:82
#67 0x00007f87a55618da in start_thread () from /lib64/libc.so.6
#68 0x00007f87a55dd48c in clone3 () from /lib64/libc.so.6

To reproduce this consistently, these are clearer steps:

QbieShay commented 1 year ago

Not the good way to go probably, but we're seeing more than one "regression" on imported files in the .godot folder. Would it make sense to force a full reimport upon minor release?

YuriSizov commented 1 year ago

@QbieShay Do you have specific issues in mind? Because this one is not about imported assets. It's about threading issues in the resource preview generator, something that we unfortunately always had. A full reimport doesn't help, not directly at least. You may offset timing of some things and "fix" the issue, but this doesn't really address the problem at its core.