A bug is here: EsotericSoftware/spine-runtimes2288
Can someone double check my investigation?
This bug reveals the issue that most of the public facing API on SpineSkeletonAnimationComponent calls CheckState which can delete the AnimationState if the skeleton or atlas has changed since the last call to CheckState. This is unsafe because the delegates on SpineSkeletonAnimationComponent are called when the EventQueue is drained. The process of draining the queue happens within the AnimationState which can be deleted by a call to CheckState.
For example, if in OnComplete you SetSkeleton and SetAtlas you've corrupted the context for the OnComplete callback.
tldr; Making almost any call to the SpineSkeletonAnimationComponent API from a SpineSkeletonAnimationComponent delegate can crash if the skeleton or atlas changed prior to the API call.
A short term workaround would be to never change the atlas or the skeleton on a SpineSkeletonAnimationComponent from a callback, but 1) this seems like an unnecessary restriction if the code was better engineered and 2) in reasonably advanced animation code a user is likely to do this anyway without realizing the risk.
An okay solution would be to not delete old AnimationState until we are at a point where we can be certain we don't have some surrounding calling context. A much better solution would be to refactor the code so that the ownership of resources is more clearly delineated and use-after-free becomes impossible.