godotengine / godotengine/godot

Possible race condition in `Skeleton` handling

Open
#88,922 0 comments 0 reactions 0 assignees View on GitHub
bug topic:3d topic:animation topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.2.1

### System information

Windows 10/11, Godot 4.2.1, Gles3 compatibility

### Issue description

I have multiple crash dumps from users where the game segfaults somewhere deep in the GPU driver. Most of these are from AMD users but I also got a couple from Nvidia GPUs so this doesn't seem to be vendor related. I am also not 100% sure all of them are using GLES3 but reasonably certain. What I can however see, is that in all crash dumps the godot main thread is currently manipulating `Skeleton3D`, Either in `Skeleton3D::_notification` with `NOTIFICATION_UPDATE_SKELETON` or in `GLES3::MeshStorage::_update_dirty_skeletons`.

### Steps to reproduce

No idea, I guess trying to rapidly modify Skeleton3D might work but I wasn't able to reproduce this issue so far. I have attached the only model with a skeleton that we are using.

Main thread:
![grafik](https://github.com/godotengine/godot/assets/11277588/e8d100e3-175b-49d3-8c06-e9a2438db0b3)

Crashed thread:
![grafik](https://github.com/godotengine/godot/assets/11277588/c3208ae9-a5f0-4ad2-b9e1-f1fe8b7b551f)

Exception:
![grafik](https://github.com/godotengine/godot/assets/11277588/dae8c926-9e4b-4396-9653-b45424b11210)

Main thread from a different dump (driver call stack was identical):
![grafik](https://github.com/godotengine/godot/assets/11277588/03460943-426c-4782-96e7-34e6f05c5575)

### Minimal reproduction project (MRP)

[robot.zip](https://github.com/godotengine/godot/files/14423031/robot.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the reported call sites, Skeleton3D::_notification with NOTIFICATION_UPDATE_SKELETON and GLES3::MeshStorage::_update_dirty_skeletons, then inspect robot.zip and the attached crash information. A useful result would require determining whether concurrent Skeleton3D manipulation causes the driver crashes, although the report currently has no reproduction steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.