[Python-Dev] Infinie recursion in Pickle

Oleg Broytmann Oleg Broytmann <phd@phd.pp.ru>
Mon, 1 Jul 2002 15:54:31 +0400


On Mon, Jul 01, 2002 at 06:46:44AM -0500, jepler@unpythonic.net wrote:
> Is this posted as an SF bug report yet?

   Not yet.

> I have a small program which can hit the recursion limit in pickle and
> cause sig11 in cPickle.  It's a very deep nested tuple in this case.

   In my case the data strucrure is more complex, but less deep. It is a
tree of objects (about 3000 objects). I tried to create lesser trees, but
the bug disappeared.
   One interesting thing to note is that when I changed builtin list back
to UserList the problem disappeared. That is, my problem is related to
pickling new classes.
   I narrowed the code to just 180 lines. The problem manifests itself
after loading initial tree, running inverse linker, and saving data back.
Inverse linker runs over all objects in the tree and adds a link to its
parent to every object. So I think the bug is in the pickling a data
structure with loops.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.