Maya 2022 - dagItem was nullptr

Maya 2022 - dagItem was nullptr

negow
Advocate Advocate
2,121 Views
6 Replies
Message 1 of 7

Maya 2022 - dagItem was nullptr

negow
Advocate
Advocate

Hi all,

 

I've been having these crashes lately with a subclasses MPxLocatorNode that I'm having trouble narrowing down and was wondering whether any one recognises the following?

 

113761802-c9bf6780-970f-11eb-9d3d-16ee4c17c75d.png

113761769-bf9d6900-970f-11eb-99f1-f711f3d98f72.png

  

 

Stack trace:
  OGSMayaBridge.dll!TdrawingChangeManager::drawableRemoved
  OGSMayaBridge.dll!TdrawingChangeManager::doModelNodeRemoved
  OGSMayaBridge.dll!DrawingChange::Tmonitor::parentRemovedCB
  Foundation.dll!TclientServer::notifyClients
  Foundation.dll!TdelayedClientServer::notifyClients
  DataModel.dll!TdagObject::removeParent
  DataModel.dll!TdagObject::removeChildAt
  DataModel.dll!Ttransform::removeChildAt
  DataModel.dll!Tmodel::removeLeafNodeFromModel
  DataModel.dll!TdagDGcommandHelper::resetSetsInformation
  DataModel.dll!TcmdOperation::doIt
  DependEngine.dll!TDGcommand::doSomeDG
  DependEngine.dll!TDGcommand::doDG
  DataModel.dll!TdagDGcommandHelper::newNodeToRemoveImp
  DataModel.dll!TdagDGcommand::newNodeToRemove
  DependEngine.dll!TDGcommand::newNodeToDelete
  OpenMaya.dll!Autodesk::Maya::OpenMaya20220000::MDGModifier::deleteNode
  _OpenMaya_py2.pyd!MPyMUserEventMessage_Type::typeObj
  python37.dll!_PyMethodDef_RawFastCallKeywords
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyEval_EvalCodeWithName
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyEval_EvalCodeWithName
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyEval_EvalCodeWithName
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyEval_EvalCodeWithName
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
  python37.dll!_PyEval_EvalCodeWithName
  python37.dll!_PyFunction_FastCallDict
  python37.dll!_PyEval_EvalFrameDefault
00007FFE05329E10

 

Crashes happen less frequently and differently under Maya 2020 and below, and my hope is that 2022 is simply more senstive to whatever wrongdoing I've committed. That solving this solves them all, just like the ring in Lord of The Rings. One can dream.

 

It happens during deletion of many nodes.

 

1. It's unclear whether it's related to the custom nodes, or just nodes in general with Maya

2. Deletion happens via `maya.api.OpenMaya.MDagModifier.deleteNode`

3. But crashes also occur when calling `maya.cmds.delete`

4. I've disabled all `::compute()`, with no effect

5. I've disabled all draw overrides, with no effect

 

The one way I'm able to avoid a crash, is if I hit that Viewport 2.0 Pause button ahead of deleting. I can then unpause and all is well.

 

Any ideas?

 

0 Likes
Accepted solutions (1)
2,122 Views
6 Replies
Replies (6)
Message 2 of 7

negow
Advocate
Advocate

It's not me, it's you. 🙂

 

- https://gist.github.com/mottosso/c183b7a70cd808b810c0be5f5ea94e97

 

Here is a reproducible with the emptiest of plug-ins and shortest of Python to reproduce it. Although you don't need Python, simply deleting with your keyboard shortcut is enough. Heck, even trying to save the scene is enough.

 

- I suspect hierarchy is involved
- I suspect the newly added `MDGModifier.deleteNode(includeParents=True)` flag to be involved
- I suspect a mixup in libraries between Python 2 and 3 (see `_OpenMaya_py2.pyd` in the stacktrace above)

 

Bug bug bug!

0 Likes
Message 3 of 7

negow
Advocate
Advocate

Ping, just to mention that this still plagues me. Has anyone else run into this yet?

0 Likes
Message 4 of 7

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I tested your sample I am able to reproduce this issue. However, I've noticed although the drawDbClassification is assigned but there isn't a drawing class registered for that classification in your sample code.

 

I replaced your sample node with a modified footPrintNode_GeometryOverride in the devkit and I can delete the dagItem without crashing Maya. Does your production code have a drawing class registered for the drawDbClassification  you've assigned for the rdRigid node?

 

According to the call stack, it is crashed in drawableRemoved inside OGSMayaBridge. OGSMayaBridge is viewport related class. If there isn't a proper drawing class registered for the rdRigid, it might cause Maya trying to release something doesn't exist and causing releasing a nullptr.

 

Yours,

Li

0 Likes
Message 5 of 7

negow
Advocate
Advocate

Thanks for looking into this Li.

 

> Does your production code have a drawing class registered for the drawDbClassification you've assigned for the rdRigid node?

 

It does, yes. Also a GeometryOverride. And it also crashes on drawableRemoved.

 

I tried replacing my override with an empty boilerplate version that does nothing, and am still seeing crashes in the same location. Would it be possible to post your modified version so I can test it here? Is there anything else I can test on my end to narrow things down further?

0 Likes
Message 6 of 7

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I only modified plugin identifiers in the footPrintNode_GeometryOverride sample and renamed output to ragdoll.mll to fit your sample scene.

 

e.g.

// Plugin identifiers
static constexpr unsigned int gPluginNodeId                 = 0x00080033;
static constexpr const char   gPluginNodeName[]             = "rdRigid";
//static constexpr const char   gPluginDrawDbClassification[] = "drawdb/geometry/footPrint_GeometryOverride";
static constexpr const char   gPluginDrawDbClassification[] = "drawdb/geometry/rdRigid";
static constexpr const char   gPluginDrawRegistrantId[]     = "footPrintNode_GeometryOverridePlugin";
static constexpr const char   gPluginSelectionMask[]        = "footPrintSelection";
static constexpr const char   gPluginNodeMessagePrefix[]    = "FootPrintGeometryOverride: ";

 

I don't have any ideas for debugging it for you right now. If that sample works for you, maybe you can use it as a baseline.

 

Hope it helps.

 

Yours,

Li

 

0 Likes
Message 7 of 7

negow
Advocate
Advocate
Accepted solution

This problem has gone away with the recent service pack, 2022.1.