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

GDScript crash while attempting to load and compile scripts running GUT unit tests #42305

Closed
Xrayez opened this issue Sep 24, 2020 · 3 comments
Closed

Comments

@Xrayez
Copy link
Contributor

Xrayez commented Sep 24, 2020

Godot version:
3.2.4.beta bca2633
I suspect regression from #41931. (CC @RandomShaper).

OS/device including version:
Tested on Windows 10 and Linux Server platforms.

Issue description:
While running unit tests with GUT:

godot.windows.tools.64.goost.exe!Map<StringName,GDScript::MemberInfo,Comparator<StringName>,DefaultAllocator>::front() Line 614 (d:\usr\src\godot\goostengine\goost\godot\core\map.h:614)
godot.windows.tools.64.goost.exe!Map<StringName,GDScript::MemberInfo,Comparator<StringName>,DefaultAllocator>::_copy_from(const Map<StringName,GDScript::MemberInfo,Comparator<StringName>,DefaultAllocator> & p_map) Line 512 (d:\usr\src\godot\goostengine\goost\godot\core\map.h:512)
godot.windows.tools.64.goost.exe!Map<StringName,GDScript::MemberInfo,Comparator<StringName>,DefaultAllocator>::operator=(const Map<StringName,GDScript::MemberInfo,Comparator<StringName>,DefaultAllocator> & p_map) Line 669 (d:\usr\src\godot\goostengine\goost\godot\core\map.h:669)
godot.windows.tools.64.goost.exe!GDScriptCompiler::_parse_class_level(GDScript * p_script, const GDScriptParser::ClassNode * p_class, bool p_keep_state) Line 1883 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_compiler.cpp:1883)
godot.windows.tools.64.goost.exe!GDScriptCompiler::compile(const GDScriptParser * p_parser, GDScript * p_script, bool p_keep_state) Line 2176 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_compiler.cpp:2176)
godot.windows.tools.64.goost.exe!GDScript::reload(bool p_keep_state) Line 605 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript.cpp:605)
godot.windows.tools.64.goost.exe!ResourceFormatLoaderGDScript::load(const String & p_path, const String & p_original_path, Error * r_error) Line 2309 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript.cpp:2309)
godot.windows.tools.64.goost.exe!ResourceLoader::_load(const String & p_path, const String & p_original_path, const String & p_type_hint, bool p_no_cache, Error * r_error) Line 270 (d:\usr\src\godot\goostengine\goost\godot\core\io\resource_loader.cpp:270)
godot.windows.tools.64.goost.exe!ResourceLoader::load(const String & p_path, const String & p_type_hint, bool p_no_cache, Error * r_error) Line 402 (d:\usr\src\godot\goostengine\goost\godot\core\io\resource_loader.cpp:402)
godot.windows.tools.64.goost.exe!GDScriptFunctions::call(GDScriptFunctions::Function p_func, const Variant * * p_args, int p_arg_count, Variant & r_ret, Variant::CallError & r_error) Line 1064 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_functions.cpp:1064)
godot.windows.tools.64.goost.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Variant::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1155 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_function.cpp:1155)
godot.windows.tools.64.goost.exe!GDScriptInstance::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 1237 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript.cpp:1237)
godot.windows.tools.64.goost.exe!Object::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 901 (d:\usr\src\godot\goostengine\goost\godot\core\object.cpp:901)
godot.windows.tools.64.goost.exe!Variant::call_ptr(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant * r_ret, Variant::CallError & r_error) Line 1128 (d:\usr\src\godot\goostengine\goost\godot\core\variant_call.cpp:1128)
godot.windows.tools.64.goost.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Variant::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1086 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_function.cpp:1086)
godot.windows.tools.64.goost.exe!GDScriptInstance::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 1237 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript.cpp:1237)
godot.windows.tools.64.goost.exe!Object::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 901 (d:\usr\src\godot\goostengine\goost\godot\core\object.cpp:901)
godot.windows.tools.64.goost.exe!Variant::call_ptr(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant * r_ret, Variant::CallError & r_error) Line 1128 (d:\usr\src\godot\goostengine\goost\godot\core\variant_call.cpp:1128)
godot.windows.tools.64.goost.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Variant::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1091 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript_function.cpp:1091)
godot.windows.tools.64.goost.exe!GDScriptInstance::call(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant::CallError & r_error) Line 1237 (d:\usr\src\godot\goostengine\goost\godot\modules\gdscript\gdscript.cpp:1237)

This seems to happen when GUT attempts to load test scripts dynamically (it collects them in a project before running).

Steps to reproduce:
This was detected in Goost while running C++ module tests using GDScript GUT addon.
Here's a log of the crash: https://github.com/goostengine/goost/runs/1160363688.

Minimal reproduction project:
Attempting to open the following project with the GUT addon should be enough to reproduce the crash:
gdscript-gut-load-crash.zip

The crash happened exactly when I created a new test script and finishing typing:

extends "res://addons/gut/test.gd"
@RandomShaper
Copy link
Member

I'll look into this in a couple of hours.

@Relintai
Copy link
Contributor

Relintai commented Sep 24, 2020

I just tried to update the engine in my project, and I can confirm. Every single one of my extends that extend other gdscript files crash.

My crash logs look a bit different though, I think it's because my project already had extends, and it crashes on launch. Nevermind, the line numbers are pretty much the same, I just haven't seen a windows crashlog in a while.

Godot version: 4bd1df8
OS/device including version: Linux

Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3d6a0) [0x7f73f28c86a0] (??:0)
[2] ./engine/bin/run.godot.x11.opt.tools.64() [0xbb4469] (/home/relintai/Projects/broken_seals/engine/./core/map.h:614)
[3] ./engine/bin/run.godot.x11.opt.tools.64() [0xbac301] (/home/relintai/Projects/broken_seals/engine/modules/gdscript/gdscript_compiler.cpp:1883)
[4] ./engine/bin/run.godot.x11.opt.tools.64() [0xbae53b] (/home/relintai/Projects/broken_seals/engine/modules/gdscript/gdscript_compiler.cpp:2178 (discriminator 4))
[5] ./engine/bin/run.godot.x11.opt.tools.64() [0xb86c37] (/home/relintai/Projects/broken_seals/engine/modules/gdscript/gdscript.cpp:605)
[6] ./engine/bin/run.godot.x11.opt.tools.64() [0xb8c417] (/home/relintai/Projects/broken_seals/engine/modules/gdscript/gdscript.cpp:2307)
[7] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[8] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[9] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[10] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[11] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[12] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[13] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[14] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[15] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[16] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[17] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[18] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[19] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[20] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[21] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[22] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[23] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[24] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[25] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[26] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[27] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[28] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[29] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[30] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[31] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[32] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[33] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[34] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[35] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[36] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[37] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[38] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[39] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[40] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[41] ./engine/bin/run.godot.x11.opt.tools.64() [0x2972f10] (/home/relintai/Projects/broken_seals/engine/scene/resources/resource_format_text.cpp:435)
[42] ./engine/bin/run.godot.x11.opt.tools.64() [0x328d632] (/home/relintai/Projects/broken_seals/engine/core/io/resource_loader.cpp:199)
[43] ./engine/bin/run.godot.x11.opt.tools.64() [0x328c973] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[44] ./engine/bin/run.godot.x11.opt.tools.64() [0x328fa3a] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:270)
[45] ./engine/bin/run.godot.x11.opt.tools.64() [0x187c8f9] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:124)
[46] ./engine/bin/run.godot.x11.opt.tools.64() [0x187e2fd] (/home/relintai/Projects/broken_seals/engine/./core/cowdata.h:377)
[47] ./engine/bin/run.godot.x11.opt.tools.64() [0x187e57f] (/home/relintai/Projects/broken_seals/engine/./core/reference.h:277)
[48] ./engine/bin/run.godot.x11.opt.tools.64() [0x187e750] (/home/relintai/Projects/broken_seals/engine/editor/editor_node.cpp:802)
[49] ./engine/bin/run.godot.x11.opt.tools.64() [0x8d6325] (/home/relintai/Projects/broken_seals/engine/./core/variant.h:434)
[50] ./engine/bin/run.godot.x11.opt.tools.64() [0x3065d07] (/home/relintai/Projects/broken_seals/engine/core/object.cpp:922 (discriminator 1))
[51] ./engine/bin/run.godot.x11.opt.tools.64() [0x307248c] (/home/relintai/Projects/broken_seals/engine/./core/variant.h:434)
[52] ./engine/bin/run.godot.x11.opt.tools.64() [0x3073630] (/home/relintai/Projects/broken_seals/engine/core/object.cpp:1307)
[53] ./engine/bin/run.godot.x11.opt.tools.64() [0x18121cd] (/home/relintai/Projects/broken_seals/engine/editor/editor_file_system.cpp:1176 (discriminator 3))
[54] ./engine/bin/run.godot.x11.opt.tools.64() [0x30655e4] (/home/relintai/Projects/broken_seals/engine/core/object.cpp:934)
[55] ./engine/bin/run.godot.x11.opt.tools.64() [0x218e15a] (/home/relintai/Projects/broken_seals/engine/scene/main/scene_tree.cpp:989)
[56] ./engine/bin/run.godot.x11.opt.tools.64() [0x21985c0] (/home/relintai/Projects/broken_seals/engine/scene/main/scene_tree.cpp:525 (discriminator 3))
[57] ./engine/bin/run.godot.x11.opt.tools.64() [0x80431a] (/home/relintai/Projects/broken_seals/engine/main/main.cpp:2114)
[58] ./engine/bin/run.godot.x11.opt.tools.64() [0x7eacd1] (/home/relintai/Projects/broken_seals/engine/platform/x11/os_x11.cpp:3238)
[59] ./engine/bin/run.godot.x11.opt.tools.64(main+0xed) [0x7d903d] (/home/relintai/Projects/broken_seals/engine/platform/x11/godot_x11.cpp:56)
[60] /usr/lib/libc.so.6(__libc_start_main+0xf2) [0x7f73f28b3152] (??:0)
[61] ./engine/bin/run.godot.x11.opt.tools.64() [0x7dc13e] (??:?)
-- END OF BACKTRACE --

@akien-mga
Copy link
Member

Fixed by #42323.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants