Monday, June 8, 2009

FAIL of the day

Since Maya's asset management is so piss-poor, studios end up building scripts and plug-ins to do the job. Let me backtrack a bit and describe how Maya's asset management works.

A Maya scene is a collection of nodes, attributes on nodes, and connections between attributes. There are a few other little details, such as plug-ins, DAG paths, references and namespaces, but that's essentially it.

There are two ways to split work between two scene files. The first is to just import the scene into your scene. This loads all the nodes (and connections and attributes) and prepends a namespace in front of all the node names to prevent name clashes. The second is called a reference. It does the same thing as an import, but links all of the nodes to a reference node as well. A reference node is a special node that tells Maya to load a bunch of nodes from another file. That way, you can refresh the reference. But, since Maya allows connections between any node, referenced nor not, provision must be made for changes to referenced nodes. It handles this by adding another, invisible blob of data called reference edits. These store changes to referenced nodes. References can be nested as well, so you can imagine how complex reference edits can get.

But I digress.

This morning I'm trying to build a scene that is basically a collection of references to other scenes. I'm using a simple MEL script to references a bunch of textured models, apply some geocached animation to them, and load the camera and set from layout. Seems simple enough. But, but, but... it fails. It spits out the usual screenfuls of dubious warnings, then segfaults.

Thinking that maybe some of our custom plug-ins were responsible, I ran the same process through gdb. Nope:

Saving Generated Scene: /dfs1/net/prod/pipeline/working/markv/clean2/projects/dot/shots/test/JR02003/light/synch/test_JR02003_light_synch.ma

[crap omitted]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47512146590080 (LWP 14527)]
0x0000000018ed0d10 in ?? ()
(gdb) where
#0 0x0000000018ed0d10 in ?? ()
#1 0x00002b363f6833ff in TDGtypeFilter::matches ()
from /usr/autodesk/maya2009-x64/lib/libDependEngine.so
#2 0x00002b363f685af4 in TDGanyFilter::matches ()
from /usr/autodesk/maya2009-x64/lib/libDependEngine.so
#3 0x00002b3642806c03 in TglobalTranslator::callNodeCallbacks ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#4 0x00002b3642806e27 in TglobalTranslator::callNodeCallbacks ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#5 0x00002b3642806ea8 in TglobalTranslator::callNodeCallbacks ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#6 0x00002b36428048cb in Tscene::saveScene ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#7 0x00002b3642804aa4 in Tscene::doSave ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#8 0x00002b36427d68d1 in TsceneOperator::saveScene ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#9 0x00002b36427d0647 in TfileCmd::handleFileSaveFlag ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#10 0x00002b36427d3e60 in TfileCmd::handleFlags ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
#11 0x00002b36427d61dd in TfileCmd::doCommand ()
from /usr/autodesk/maya2009-x64/lib/libShared.so
---Type to continue, or q to quit---
#12 0x00002b363f3b3406 in Mel_Command_Dispatch ()
from /usr/autodesk/maya2009-x64/lib/libCommandEngine.so
#13 0x00002b363f3d8152 in node_exec ()
from /usr/autodesk/maya2009-x64/lib/libCommandEngine.so
#14 0x00002b363f3d832f in sophia_call_executable ()
from /usr/autodesk/maya2009-x64/lib/libCommandEngine.so
#15 0x00002b363f3f4f2e in SophiaExecutable::evaluate ()
from /usr/autodesk/maya2009-x64/lib/libCommandEngine.so
#16 0x00002b363f3b9e42 in TcommandEngine::sourceFile ()
from /usr/autodesk/maya2009-x64/lib/libCommandEngine.so
#17 0x000000000040f4a1 in TmayaApp::initAfter ()
#18 0x000000000040d9c9 in TmayaApp::initBatch ()
#19 0x00002b36401fe43c in Tapplication::start ()
from /usr/autodesk/maya2009-x64/lib/libExtensionLayer.so
#20 0x000000000041060b in appmain ()
#21 0x000000000041e93b in main ()
(gdb) quit

Here's the kicker: the same script, run from interactive Maya does not crash.

How in the hell does a piece of software that's 10 years old still have a bug that causes it to segfault?

FAIL.

No comments:

Post a Comment