[pypy-commit] pypy default: The recent rewrite of crash_in_jit() lost the original traceback

arigo noreply at buildbot.pypy.org
Thu Jul 28 18:00:20 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r46043:e02ef353c3c8
Date: 2011-07-28 10:22 +0200
http://bitbucket.org/pypy/pypy/changeset/e02ef353c3c8/

Log:	The recent rewrite of crash_in_jit() lost the original traceback in
	non-translated versions.

diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -409,6 +409,7 @@
         jd.warmstate = state
 
         def crash_in_jit(e):
+            tb = not we_are_translated() and sys.exc_info()[2]
             try:
                 raise e
             except JitException:
@@ -422,8 +423,8 @@
                     print "~~~ Crash in JIT!"
                     print '~~~ %s: %s' % (e.__class__, e)
                     if sys.stdout == sys.__stdout__:
-                        import pdb; pdb.post_mortem(sys.exc_info()[2])
-                    raise
+                        import pdb; pdb.post_mortem(tb)
+                    raise e.__class__, e, tb
                 fatalerror('~~~ Crash in JIT! %s' % (e,), traceback=True)
         crash_in_jit._dont_inline_ = True
 


More information about the pypy-commit mailing list