[Python-bugs-list] [ python-Bugs-576084 ] Sig11 in cPickle (stack overflow)
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 22 Sep 2002 01:22:47 -0700
Bugs item #576084, was opened at 2002-07-01 20:34
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=576084&group_id=5470
Category: Python Library
Group: None
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Jeff Epler (jepler)
Assigned to: Martin v. Löwis (loewis)
Summary: Sig11 in cPickle (stack overflow)
Initial Comment:
The following program dies for me with a sig11. It
appears that cPickle overflows the stack of the thread
where it executes. (In my platform, the main thread's
stack is very large, but other threads' stacks are
fairly small)
Should some kind of guard be added in cPickle to stop
the overflow?
This does safely die with a "RuntimeError: maximum
recursion depth exceeded" when using regular pickle.
(I wrote this simple program after a python-dev poster
wrote that a "deeply recursive data structure" was
sometimes causing a sig11 inside cPickle. I do not
know if this is the same problem as his or not)
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-09-22 10:22
Message:
Logged In: YES
user_id=21627
Also committed as cPicke.c 2.73.2.1.2.2.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-08-05 17:19
Message:
Logged In: YES
user_id=21627
Not right now. I'd wait a while to see whether anybody
notices this change in CVS Python; if nobody does,
backporting it should be fine.
The backport is probably not straight-forward, because of
white-space changes.
Reopening.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-05 17:01
Message:
Logged In: YES
user_id=6380
Hm, since it *does* fix a real bug, I think that that's an
acceptable risk. We just need to mention the risk in the
NEWS file. Mind backporting this after all?
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-08-04 10:22
Message:
Logged In: YES
user_id=21627
Applied as cPickle.c 2.93.
I have not backported it to 2.2, since it carries the risk
that you get a RuntimeError in pickling, even though
pickling would currently comlete just fine.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-02 22:30
Message:
Logged In: YES
user_id=6380
Looks good. It fixes the test case. Only comment: would the
call to Py_GetRecursionLimit() cause a measurable slowdown?
(Hard to believe given the amount of work that's done
already.) Suggestion: check it in.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-07-30 17:21
Message:
Logged In: YES
user_id=21627
Can you please try the attached patch?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=576084&group_id=5470