Closed spellcard199 closed 1 year ago
I believe this was fixed by #73679. Let me know if it still happens in RC4 or later
I believe this was fixed by #73679. Let me know if it still happens in RC4 or later
I can confirm it's fixed in RC4. Thanks.
Godot version
4.0 dev (e9c7b8d2246bd0797af100808419c994fa43a9d2)
System information
Linux Fedora, Vulkan API 1.3.205 - Forward+ - Using Vulkan Device 1: NVIDIA - NVIDIA GeForce 940MX
Issue description
Expected behavior: if some gdscript files in a project are missing Godot should show an error, not crash.
Backtrace:
Seems like the crash happens at modules/gdscript/gdscript_cache.cpp#L61, in the first line of
Error GDScriptParserRef::raise_status(Status p_new_status)
:I have an hypothesis on why it's happening, however this is my first time using gdb, so this is only a C++ beginner's speculation.
get_parser_for(autoload.path)
returns an invalid referenceref
.ref->raise_status(GDScriptParserRef::INHERITANCE_SOLVED)
is called:Error GDScriptParserRef::raise_status(Status p_new_status)
tries to access itsparser
field, but accessing a field of an invalid reference results in crash.The reason why
Ref<GDScriptParserRef> GDScriptAnalyzer::get_parser_for(autoload.path)
returned an invalid reference may be because:GDScriptAnalyzer::get_parser_for
invokesGDScriptCache::get_parser
.At modules/gdscript/gdscript_cache.cpp#L207, inside
GDScriptCache::get_parser
:ref
is created:In the code path where
p_path
doesn't exist,ref
is never instantiated:I tried adding the following line inside the if block and the crash stopped happening, but I didn't make a PR because I don't know if that's how
ref
is supposed to be used, nor if it's the right place to do it.Steps to reproduce
I wasn't able to reduce it to a minimal project, but this is how I happened to trigger it:
Clone project (the correct command would be
git clone --recurse-submodules "https://github.com/V-Sekai/v-sekai-game.git"
, but we are trying to trigger the crash here)Open project in Godot editor.
Click OK on warning about double precision causing loss of information.
Wait for crash.
Minimal reproduction project
N/A