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

Crash on reimport when applying AnimatedValueBackups from an Apply Reset #85233

Closed
lyuma opened this issue Nov 22, 2023 · 1 comment · Fixed by #85266
Closed

Crash on reimport when applying AnimatedValueBackups from an Apply Reset #85233

lyuma opened this issue Nov 22, 2023 · 1 comment · Fixed by #85266

Comments

@lyuma
Copy link
Contributor

lyuma commented Nov 22, 2023

Godot version

4.2.rc 7022271

System information

Godot v4.2.rc (7022271) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 Threads)

Issue description

Godot crashes due to a complicated chain of events in the stack trace involving reimport_files, reload_scene and a synchronous clear_history which memdeletes several dangling TrackCache pointers in this RefCounted AnimatedValuesBackup ?!

Critical error detected c0000374
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in godot.windows.editor.x86_64.exe.

image

Something feels very wrong about holding raw pointers to an AnimationMixer TrackCache in AnimatedValuesBackup. I can't follow the flow at all of how values get stored in AnimatedValuesBackup.

To maintain single-free semantics, these TrackCache* values must be moved and owned by the AnimatedValuesBackup.

TrackCache pointers must never be shared by other objects, otherwise a use-after-free or double-delete is likely to happen

Steps to reproduce

  1. Follow the steps in Animation window Edit -> Apply Reset fails because AnimationMixer::_reset is not exposed #85232 to Apply Reset on an opened gltf
  2. Select the gltf in the filesystem (it will already be selected if you followed the steps)
  3. Open the Import dock and click Reimport
  4. Godot will crash.

Minimal reproduction project

ApplyReset.zip

@YuriSizov
Copy link
Contributor

YuriSizov commented Nov 22, 2023

Related to #85093, which had the condition for this error fixed rather than the error itself. It was also identified as a potential issue in #84942 (comment).

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.

3 participants