New submission from Daniel Darabos <[EMAIL PROTECTED]>:

The documentation[1] says:

  Trying to pickle a highly recursive data structure may exceed the
  maximum recursion depth, a RuntimeError will be raised in this
  case. You can carefully raise this limit with sys.setrecursionlimit().

The lightweight pickle module handles this problem correctly (in that it
raises a RuntimeError), but cPickle sometimes raises KeyError instead,
or just silently terminates the interpreter (=crashes). (I have not been
able to pinpoint what it depends on. In the attached example I get
silent termination, but if instead of lists I use sets to describe the
connections, I get the RuntimeError.)

This was mentioned in issue 2480, but that has now been changed to a
feature request to eliminate recursion altogether. That may have a lower
priority, but this crash can be hard to diagnose in a complex
application, and I am not sure if sys.setrecursionlimit() affects
cPickle behavior (I guess not).

[1]: http://docs.python.org/lib/node317.html

----------
components: Library (Lib)
files: bugdemo.py
messages: 65876
nosy: alexandre.vassalotti, bkline, cyhawk, jcea, schmir
severity: normal
status: open
title: pickling of large recursive structures crashes cPickle
type: crash
versions: Python 2.5
Added file: http://bugs.python.org/file10119/bugdemo.py

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2702>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to