Browse Source

Makepanda now automatically uses gdb to grab the traceback if a child process segfaulted

rdb 16 years ago
parent
commit
e4c54ae287
1 changed files with 6 additions and 0 deletions
  1. 6 0
      makepanda/makepandacore.py

+ 6 - 0
makepanda/makepandacore.py

@@ -216,6 +216,12 @@ def oscmd(cmd, ignoreError = False):
         res = os.spawnl(os.P_WAIT, exe, cmd)
     else:
         res = os.system(cmd)
+        if (res == 11):
+            if (LocateBinary("gdb") and GetVerbose()):
+                print GetColor("red") + "Received SIGSEGV, getting traceback..." + GetColor()
+                os.system("gdb -batch -ex 'handle SIG33 pass nostop noprint' -ex 'set pagination 0' -ex 'run' -ex 'bt full' -ex 'info registers' -ex 'thread apply all backtrace' -ex 'quit' --args %s < /dev/null" % cmd)
+            else:
+                print GetColor("red") + "Received SIGSEGV" + GetColor()
     if res != 0 and not ignoreError:
         exit("")