Mayapy crashes while loading scene file with locked references (maya 2017 update 4)

168 views
Skip to first unread message

Alok Gandhi

unread,
Apr 24, 2018, 7:59:21 AM4/24/18
to python_in...@googlegroups.com
mayapy segfaults when trying to scene files with references locked (not attributes but the ref node itself is locked)

Maya Version: Autodesk Maya 2017 Update 4


Repro:
  1. Create a file reference(any maya file, contents do not matter) in an empty maya scene.
  2. Right-click on the referenced node in the outliner.
  3. In the context menu select Reference > Lock.
  4. Save the file.
  5. Run the following script in the mayapy interpreter ($ mayapy lock.py)
# lock.py
import maya.standalone
maya.standalone.initialize()

import maya.cmds as cmds
cmds.file(
    'path/to/file/in/repro/step/4/above',
    open=True,
    force=True
)

maya.standalone.uninitialize()

mayapy will segfault with the following stack trace:
Stack trace:
  TfileUtil::lockReference(TsceneFile*)
  TloadReference::lockReference(TsceneFile*)
  TloadReference::lockAllReferences(TsceneFile*)
  TglobalTranslator::doReadFile(TsceneFile&, bool, bool)
  TfileUtil::readFile(TsceneFile*, bool, bool, bool)
  TsceneOperator::openFile(TsceneFile*, bool, bool)
  TfileCmd::handleFileOpenFlag(TargDatabase&, TsceneFile*)
  TfileCmd::handleFlags(TargDatabase&, TsceneFile*, TnamespaceSwapper*, TgraphDiff*)
  TfileCmd::handleFlags(TargDatabase&, Tstring const&)
  TfileCmd::doCommand(TargList&)
  TpythonInterpreter::dispatchMayaCommand(TmetaCommand&, _object*, _object*)
  PyEval_EvalFrameEx
  PyEval_EvalCodeEx
  PyEval_EvalCode
  PyRun_FileExFlags
  PyRun_SimpleFileExFlags
  Py_Main
  __libc_start_main
/<maya intall dir>/bin/python-bin() [0x400649]
All the calls starting with Py** at the bottom of the stack trace are standard Python C API functions.

Did anyone experience this? If yes it there a way around this (using mayapy). I could not find this in the know bugs.

For what it's worth - 
This works flawlessly calling python from  mel  non-gui mode of maya binary for interactive non-gui mode.
maya -prompt -command "python(\"import maya.cmds as cmds;cmds.file(\\\"path/to/file/in/repro/step/4/above\\\", open=True, force=True)\");quit -f;"



Thanks,

- Alok

Reply all
Reply to author
Forward
0 new messages