[Python-Dev] Python 2.6 on AMD64 recusion crash

Mark Hammond mhammond at skippinet.com.au
Thu Aug 21 04:37:43 CEST 2008


While looking at 2.6 for Windows, I've found a recursion related crash in
test_cpickle on 64bit builds.  Specifically, the 'cPickleDeepRecursive' is
causing a stack overflow, and the debugger tells me the actual recursion
depth was 629 at the crash.

The reason the 64bit build doesn't see more crashes is apparently due to
another regression in 2.6 - http://bugs.python.org/issue3373.  It appears
that in some cases, the recursion counter is actually incremented *twice*
for each entry, thereby causing the "maximum recursion depth exceeded"
exception to appear at a true recusion limit of 500.  However, test_cpickle
takes a different path and doesn't see this doubling of the count -
therefore dieing at the depth of 629 that I can see.

My solution to this was to simply double the stack size for the executables
in 64bit builds, from 2MB to 4MB (2.1 and 4.2 for debug builds.)  Is this an
appropriate fix?
 
Cheers,

Mark





More information about the Python-Dev mailing list