Hi,

while working on the Py3 exception code, I discovered that something in the
tree transformation or tree assertion code makes the Python interpreter
crash during the test suite run. I didn't manage to track it down yet, but
at least I'm certain that this can be reproduced without loading any Cython
built modules (including the refnanny), so it's not a problem with the code
that Cython generates but with CPython itself. It looks like something in
the tree traversal code corrupts sys.exc_info by leaving a reference to a
deallocated exception in there. Trying to print it (e.g. after running a
doctest) will then lead to the crash. I tried this with both Python 3.1.1
and the latest Py3k branch (3.2) and got the same result.


To make sure that this isn't just a problem on my side, could someone else
please try the steps below with CPython 3.1.1 and the latest cython-devel?


To reproduce it, please do this:

1) apply the attached patch that simply prints sys.exc_info() during the
tree assertions phase of the compiler run

2) run

        python3.1 runtests.py --no-cleanup --no-cpp --no-pyregr \
                              --no-doctest -vv 'compile\.first_assignment'

3) potentially re-run step 2)

This will run a single compile test and crashes reliably for me during the
tree-assertions phase. You may have to re-run step 2) as the first run will
2to3-ify the source and then run the test without crashing. Only the
subsequent runs will crash reliably.

Thanks,

Stefan
diff -r 4c945b09dc26 Cython/TestUtils.py
--- a/Cython/TestUtils.py	Sun Oct 18 14:52:43 2009 +0200
+++ b/Cython/TestUtils.py	Sun Oct 18 16:46:07 2009 +0200
@@ -163,6 +163,9 @@
                         node.pos,
                         "Unexpected path '%s' found in result tree" %  path)
         self.visitchildren(node)
+        print("HIER1")
+        print(sys.exc_info())
+        print("HIER2")
         return node
 
     visit_Node = VisitorTransform.recurse_to_children
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to