Search Unity

Bug A crash when using Playables API

Discussion in 'Animation' started by Cardinal90, Mar 31, 2023.

  1. Cardinal90

    Cardinal90

    Joined:
    Aug 9, 2017
    Posts:
    15
    I'm not sure, if I should post it here or in the Timeline section. We are not actually using timeline, just doing very basic sprite animation with playables.

    So, one of thousands of players of our game has been reporting frequent crashes. The exception is
    c0000005 (Access violation), here are some stack traces from crash dumps:

    Code (csharp):
    1.  
    2. UnityPlayer!AnimationMixerPlayable::MixerProcess+0x10c
    3. UnityPlayer!AnimationMixerPlayable::ProcessRootMotion+0xbb
    4. UnityPlayer!`anonymous namespace'::ProcessPlayableGraph+0x26b
    5. UnityPlayer!Animator::ProcessRootMotionStep+0x23e
    6. UnityPlayer!Animator::ProcessRootMotionJob+0x74
    7. UnityPlayer!UnityEngine::Animation::BlockRangeJob<Animator::AnimatorJob>::Job+0x38
    8. UnityPlayer!JobQueue::Exec+0x52
    9. UnityPlayer!JobQueue::ProcessJobs+0x127
    10. UnityPlayer!JobQueue::WorkLoop+0x40
    11. UnityPlayer!Thread::RunThreadWrapper+0x58
    12. kernel32!BaseThreadInitThunk+0x10
    13. ntdll!RtlUserThreadStart+0x2b
    14.  

    Code (csharp):
    1.  
    2. UnityPlayer!Animator::ProcessRootMotionJob+0x74
    3. UnityPlayer!UnityEngine::Animation::BlockRangeJob<Animator::AnimatorJob>::Job+0x38
    4. UnityPlayer!JobQueue::Exec+0x52
    5. UnityPlayer!JobQueue::ProcessJobs+0x127
    6. UnityPlayer!JobQueue::WorkLoop+0x40
    7. UnityPlayer!Thread::RunThreadWrapper+0x58
    8. kernel32!BaseThreadInitThunk+0x10
    9. ntdll!RtlUserThreadStart+0x2b
    10.  

    Code (csharp):
    1.  
    2. UnityPlayer!PlayableTraverser::CreateNewVisitorInfo+0xd2
    3. UnityPlayer!PreOrderPlayableTraverser::RecursiveVisit+0x9e
    4. UnityPlayer!PreOrderPlayableTraverser::Traverse+0x25e
    5. UnityPlayer!PlayableOutput::PrepareTraverse+0x137
    6. UnityPlayer!PlayableGraph::PrepareFrame+0x13b
    7. UnityPlayer!PrepareFrameJobFunc+0xb6
    8. UnityPlayer!JobQueue::Exec+0x52
    9. UnityPlayer!JobQueue::ProcessJobs+0x127
    10. UnityPlayer!JobQueue::WorkLoop+0x40
    11. UnityPlayer!Thread::RunThreadWrapper+0x58
    12. kernel32!BaseThreadInitThunk+0x10
    13. ntdll!RtlUserThreadStart+0x2b
    14.  

    The game is in pixel-art style. The way I am using the Playables API is I am connecting all the possible animations to one mixer. Whenever I need to change the current animation, I am setting its weight to 1 and the weight of the previously active animation to 0. Sometimes more animations need to be added later - then I change the mixer's input count and connect the additional animations. I don't inherit from PlayableBehaviour anywhere.

    The crashes don't seem to have a pattern, at least the user couldn't describe one. I don't think submitting a bug report will help as it is probably not reproducible except on a particular user's machine. This is a long shot, but does anyone have any ideas about what could be causing this issue?