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

Silent Crash when readding an Animation in an AnimationLibrary #96794

Closed
madokadev opened this issue Sep 10, 2024 · 4 comments
Closed

Silent Crash when readding an Animation in an AnimationLibrary #96794

madokadev opened this issue Sep 10, 2024 · 4 comments

Comments

@madokadev
Copy link

Tested versions

  • Reproducible in v4.3.stable.official [77dcf97]
  • Not Reproducible in v4.1.4.stable.official [fe0e8e5]

System information

Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.3770) - AMD Ryzen 7 5800 8-Core Processor (16 Threads)

Issue description

Create an AnimationLibrary in an AnimationPlayer, and add an animation (by code, while the project is running). If you then readd the same animation (optionally with some changes) to that library, the game will eventually crash silently if you do this too often.
Removing the animation first doesn't prevent the crash, stopping the animation before overwriting it does. See below for a video and an MRP.

Steps to reproduce

Open the sample project, press the button a couple of times. In general it takes me three tries for the editor to crash, though it can be more or less if you're lucky.
Alternatively, watch the attached webm.
bug.webm

Minimal reproduction project (MRP)

AnimationBug.zip

@matheusmdx
Copy link
Contributor

Bisecting points to #80813 as the culprit, @TokageItLab

image

image

Backtrace:
CowData<char32_t>::size() Line 136 (c:\Users\Matheus\Downloads\Godot Source\core\templates\cowdata.h:136)
String::size() Line 217 (c:\Users\Matheus\Downloads\Godot Source\core\string\ustring.h:217)
String::length() Line 273 (c:\Users\Matheus\Downloads\Godot Source\core\string\ustring.h:273)
String::is_empty() Line 411 (c:\Users\Matheus\Downloads\Godot Source\core\string\ustring.h:411)
StringName::StringName(const String & p_name, bool p_static) Line 336 (c:\Users\Matheus\Downloads\Godot Source\core\string\string_name.cpp:336)
AnimationPlayer::play(const StringName & p_name, double p_custom_blend, float p_custom_scale, bool p_from_end) Line 390 (c:\Users\Matheus\Downloads\Godot Source\scene\animation\animation_player.cpp:390)
call_with_variant_args_helper<AnimationPlayer,StringName const &,double,float,bool,0,1,2,3>(AnimationPlayer * p_instance, void(AnimationPlayer::*)(const StringName &, double, float, bool) p_method, const Variant * * p_args, Callable::CallError & r_error, IndexSequence<0,1,2,3> __formal) Line 303 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:303)
call_with_variant_args_dv<AnimationPlayer,StringName const &,double,float,bool>(AnimationPlayer * p_instance, void(AnimationPlayer::*)(const StringName &, double, float, bool) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector<Variant> & default_values) Line 451 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:451)
MethodBindT<AnimationPlayer,StringName const &,double,float,bool>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 337 (c:\Users\Matheus\Downloads\Godot Source\core\object\method_bind.h:337)
Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 767 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.cpp:767)
Variant::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error) Line 1170 (c:\Users\Matheus\Downloads\Godot Source\core\variant\variant_call.cpp:1170)
GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1741 (c:\Users\Matheus\Downloads\Godot Source\modules\gdscript\gdscript_vm.cpp:1741)
GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1843 (c:\Users\Matheus\Downloads\Godot Source\modules\gdscript\gdscript.cpp:1843)
Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 745 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.cpp:745)
Variant::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error) Line 1170 (c:\Users\Matheus\Downloads\Godot Source\core\variant\variant_call.cpp:1170)
GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1741 (c:\Users\Matheus\Downloads\Godot Source\modules\gdscript\gdscript_vm.cpp:1741)
GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1843 (c:\Users\Matheus\Downloads\Godot Source\modules\gdscript\gdscript.cpp:1843)
Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 745 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.cpp:745)
Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 62 (c:\Users\Matheus\Downloads\Godot Source\core\variant\callable.cpp:62)
Object::emit_signalp(const StringName & p_name, const Variant * * p_args, int p_argcount) Line 1118 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.cpp:1118)
Node::emit_signalp(const StringName & p_name, const Variant * * p_args, int p_argcount) Line 3596 (c:\Users\Matheus\Downloads\Godot Source\scene\main\node.cpp:3596)
Object::emit_signal<>(const StringName & p_name) Line 920 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.h:920)
Timer::_notification(int p_what) Line 62 (c:\Users\Matheus\Downloads\Godot Source\scene\main\timer.cpp:62)
Timer::_notificationv(int p_notification, bool p_reversed) Line 37 (c:\Users\Matheus\Downloads\Godot Source\scene\main\timer.h:37)
Object::notification(int p_notification, bool p_reversed) Line 832 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.cpp:832)
SceneTree::_process_group(SceneTree::ProcessGroup * p_group, bool p_physics) Line 950 (c:\Users\Matheus\Downloads\Godot Source\scene\main\scene_tree.cpp:950)
SceneTree::_process(bool p_physics) Line 1031 (c:\Users\Matheus\Downloads\Godot Source\scene\main\scene_tree.cpp:1031)
SceneTree::process(double p_time) Line 510 (c:\Users\Matheus\Downloads\Godot Source\scene\main\scene_tree.cpp:510)
Main::iteration() Line 3573 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:3573)
OS_Windows::run() Line 1474 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\os_windows.cpp:1474)
widechar_main(int argc, wchar_t * * argv) Line 182 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:182)
_main() Line 204 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:204)
main(int argc, char * * argv) Line 218 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:218)
WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 232 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:232)
[Inline Frame] invoke_main() Line 102 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:102)
__scrt_common_main_seh() Line 288 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
kernel32.dll!00007ffa15697374() (Unknown Source:0)
ntdll.dll!00007ffa157dcc91() (Unknown Source:0)

@Nazarwadim
Copy link
Contributor

Cannot reproduce in 4.4 dev2

not_working.mp4

@akien-mga akien-mga added this to the 4.4 milestone Sep 17, 2024
@akien-mga
Copy link
Member

I can't reproduce either on Linux in 4.3.stable, but this might be system or platform specific.

@akien-mga
Copy link
Member

Duplicate of #86691 judging by the stacktrace.

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