I am facing a really weird situation trying to find out why a script I wrote is hard crashing Maya 2011 when executed.
I just got the demo of 2011 to try to debug as I only have a 2009 right now, so I might have missed some announcement about some changes in way things are done?
The script works fine until I start using the main core loop and start accessing the API.
When Maya crash, it really is a hard crash, no error or warning whatsoever in any of the logs. Just a plain crash (either the Maya window is killed instantly, or you get prompted with the default Autodesk give us feedback dialog crash thingy).
The script has been working without any issues since 2008sp2 where python was introduced in Maya I believe.
I’ve put a bunch of calls to dialogboxes and many print commands to identify where the script actually fails, but from one session to the next, the crash doesn’t happen at the same position nor in the same classes/functions.
For the record I am not using any kind of threading anywhere in my code.
I am not really sure how I could approach this problem since I am lacking tools to get a proper trace going.
I’ll attempt to get the python debug module thingy going during the week end, but I would appreciate any input from the seasoned TAs around here
My colleague was recently working with raycasting using the maya python api and I think that some of the parameters may have changed in the api call since 2008, he was working in 2010 I believe, so maybe something there, sorry i cant remember anything more specific.
As for tracing the bug, try wrapping your code in try: except: blocks to try and catch the problem that way and narrow down the cause.
And a third point I have tried recently and had some success remote debugging using winpdb, quite easy to setup with a script and may help and its also a lot nicer than pdb :):
thanks for the suggestions.
so far I’ve just been going the… ahem… rookie way. putting prints and confirmDialog everywhere I could to trace what I could until the crash.
I’ll go and revisit the code and implement the try/except wrapper around the API calls. hopefully that will help.
Though I am not getting any stack traceback error whatsoever at any point. just Maya being terminated instantly
What was puzzling me was that from one attempt to the next, the manual trace I was getting was stopping at totally different places in the code. Hopefully it’s not a more serious problem with my code and I’ll be able to narrow it down.
I started looking at the pdb documentation, and hopefully I won’t have to go that far ahah.