Maya Fatal Crash on Play

Hello!

I’ve been trying to debug a consistent and fatal crash that occurs on one of my ragdoll-ed characters that happens as soon as I hit play, or a few seconds afterward (it varies). I’m a bit at a loss as to the cause of the crash, and don’t have a ton of leads/details I can give, but will provide as much detail as I can.

First off, I’m working in Maya 2022.5, in Python 2, tho I have also tried playing the scene in 2023 Python 3 and experienced the same crash. I’m using Ragdoll version 2023.11.20, and have an Unlimited license.

Maya’s crash log .dmp says the crash is due to an unhandled error, error “0xc0000005 EXCEPTION ACCESS VIOLATION”. Upon research, this appears to have something to do with corrupted system files, but after following Autodesk’s fix, the crash continues to happen. I also tried deleting the ragdoll from the rig and playing, to see if the crash continued (I expect it would, if it was a corrupted file?) but the raw rig didn’t crash. So I believe this narrows it down to a ragdoll issue. Curiously tho, other ragdoll-ed characters didn’t crash on me either when I tested them.

Some info on the anim scene: it is an empty scene, with only the ragdoll-ed character referenced in. The animation is only five keys on the root control; nothing else. It crashes either immediately after I hit play, or a few seconds afterward.

Some info on the rig and my debugging process: it’s a full body ragdoll, with several groups and a few markers with custom limits and overlap numbers. There are several markers almost totally overlapping (think drawer inside of a filing cabinet kind of overlapping). I lowered the density of the head markers to .01, to make it easier for them to sit on a tiny neck without drooping. The arm markers are shared between the IK and FK controls via the append targeting function. All the markers are custom meshes, some with a few islands for detail. Essentially, this is how I usually build ragdoll onto rigs.
For debugging, I deleted the entire ragdoll and started from scratch; I would add markers, check it for crashes, replace mesh, check it for crashes, etc etc until I finally got it to crash again: it crashed after I appended the IK controls onto the FK control markers. So I checked it with markers only targeted to the FK controls - no crash. Only targeted to the IK controls- crash. Okay, so I’m thinking it’s gotta be something with the IK controls, right? Today I checked it again, only targeted to the FK controls and . . . it crashed. Threw me for a loop. So I deleted all the right arm markers to check, and it crashed! I am at a complete loss. Note that I am checking for crashes on the same animation file, just updating the reference.

Any help in debugging this would be spectacular, because at the moment this rig is unusable with ragdoll. I’ve gotten reports of crashes on other ragdoll-ed rigs from my animators, but none as consistently as this one (and I’m hoping answering why this one crashes will help me debug the others as well). I’m sorry I don’t have better leads and can’t share my files; hopefully these details will be enough :sob:

Hi Hallie, thanks for reporting this. Let’s see if we can narrow this down.

Assuming the crash happens on play and that you are able to open and edit the file first, try this.

  1. Select all Markers and set their Shape Type to Capsule rather than Mesh. It’s unlikely, but possible that one of the meshes is causing issues for Ragdoll
  2. Change your scene scale, this effectively scales the vertices of your meshes which also affects how the collision meshes are generated, which like (1) can be involved in the crash
  3. It is unlikely but possible that assigning to things is indirectly involved in a crash, in which case changing Maya’s evaluation mode from Parallel to DG or Serial may have an effect. If this is the crash, then anything reading the worldMatrix from your rig in parallel would cause it.
  4. As an alternative to (3) you could try baking relevant (or all) controls to locators and assigning to those instead. Reading the worldMatrix from those baked locators would not incur the same evaluation of the overall rig and - if evaluation is to blame - should not cause a crash.

Because the crash is semi-random, it’s possible there is an evaluation glitch somewhere. I’m thinking of how to confirm this in a non-Ragdoll way to narrow your search, and the closest thing I can think of is plugging the world matrices into 1 native Maya node and reading from it every frame just like Ragdoll does. The multMatrix node could do, with a decomposeMatrix following it such that you can plug the resulting outTranslate into a cube visible in the viewport. That would cause Maya to render the cube, which pulls on outTranslate which in turn pulls on all of your rig controls, this should happen in parallel just like Ragdoll does.

  • For each control:
    • rigControl.worldMatrix[0]multMatrix.matrixIn[0]
    • multMatrix.matrixSumdecomposeMatrix.inMatrix
    • decomposeMatrix.outTranslatepCube1.translate

That’s what I can think of for now, if you end up trying that last bit but find it too complex, let me know and I’ll whip up a script for you.

Thanks for the debug steps!

Changing the meshes to capsules, and changing the scene scale both still resulted in a crash. However, changing the evaluation to DG did seem to stop the crash! It played for over 5 minutes and didn’t crash once! This is with the custom meshes still assigned, and scene scale at 1.

I’m now working on plugging in all the controls’ world matrices into cubes- there’s a lot of them so I won’t have it done today, but wanted to update you on the DG success. What do you think caused the evaluation to start glitching on this particular rig? Could something not be setup correctly? I’d prefer if I didn’t have to stick to DG, if possible.

I also wanted to ask, as I plug in these cubes: when I finish plugging them in, they go back to world origin. I’m assuming it’s because the world matrices on all the controls are at 0,0,0 when the rig is in t-pose, but wanted to be sure that’s the expected behavior. I’m also wondering what I should be looking for once I’m done plugging these in. Should I see some cubes going crazy, or expect a crash?

Thank you!

With DG solving it in mind, my guess is just “Maya”.

Sometimes it crashes. With Ragdoll assigned, it’s asking Maya to evaluate all of the world matrices of the rig in parallel and if you’re at a big shop with other custom nodes then those nodes would need to be implemented in a way that supports threading just like Ragdoll does. Sometimes Maya can struggle when you have an e.g. follicle trying to follow some geometry with malformed vertices/faces/edges, which in turn drives some space switching constraint etc.

I expect it will crash with this multMatrix trick too, but it’s hard to say for sure because parallel will literally generate a node graph dynamically based on the order and type of which nodes connect. But you shouldn’t have to plug these manually, that would be a pain. :sweat_smile: It’s late here now, but I can whip up a small script you can run to do this automatically tomorrow morning.

Another option is to tell the Ragdoll solver to explicitly solve in serial, rather than your entire Maya scene. I can dig up the command for you to do try that as well. It would strip some performance, but nowhere near doing it to the whole scene. You can try and find it for yourself as well, it’s related to evaluation and it’s in maya.cmds. You would apply it to the rSolver node, to force it to run in serial or “untrusted” mode as it’s called.

Hi and sorry for the slow response - we believe we’ve figured out the problem!!

One of my animators started experiencing crashes with the rig WITHOUT ragdoll, so we took a deeper look at the rig itself and the animator’s crash logs. Turns out there were some dirty parent constraints caused by shifting the world from Z-up to Y-up in the middle of rigging. We fixed those, and tested the rig without and with ragdoll, and it appears to have stopped crashing! :grin:
What I’m thinking is the rig always had evaluation errors, it just took a larger animation scene to cause it to crash. Adding ragdoll exacerbated the errors and caused a crash sooner, which is why I was seeing the crashes sooner than the animator. That’s my hunch, anyway. Hopefully it stays stable!

For anyone else looking into crashes, I did scrape together a little script to help connect cubes to controls’ world matrices easier; I’ll share it here for anyone to use. Just select all your controls, and run this script in a Python 2 tab (it’ll probably work for Python 3 as well, but is untested):


def parellelcrashtest():
    import maya.cmds as mc
    cons = mc.ls(sl=True)
    for con in cons:
        multinode = mc.shadingNode("multMatrix", asUtility=True)
        mc.connectAttr(con + ".worldMatrix[0]", multinode + ".matrixIn[0]", force=True)
        decomposenode = mc.createNode("decomposeMatrix")
        mc.connectAttr(multinode + ".matrixSum", decomposenode + ".inputMatrix", force=True)
        cube = mc.polyCube(name= con + "_Cube")[0]
        mc.connectAttr(decomposenode + ".outputTranslate", cube + ".translate", force=True)
    
    return 

parellelcrashtest()

Thank you for your help Marcus!! I always enjoy learning more ways to debug :beetle:

Lovely! :partying_face: Thanks for sharing.