This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Sig11 in cPickle (stack overflow)
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: gvanrossum, jepler, loewis
Priority: normal Keywords:

Created on 2002-07-01 18:34 by jepler, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
kp.py jepler, 2002-07-01 18:34 causes sig11 when executed
cPickle.diff loewis, 2002-07-30 15:21
Messages (7)
msg11425 - (view) Author: Jeff Epler (jepler) Date: 2002-07-01 18:34
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)
msg11426 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-07-30 15:21
Logged In: YES 
user_id=21627

Can you please try the attached patch?
msg11427 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-02 20:30
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.
msg11428 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-08-04 08:22
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.
msg11429 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-05 15:01
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?
msg11430 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-08-05 15:19
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.
msg11431 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-09-22 08:22
Logged In: YES 
user_id=21627

Also committed as cPicke.c 2.73.2.1.2.2.
History
Date User Action Args
2022-04-10 16:05:28adminsetgithub: 36835
2002-07-01 18:34:39jeplercreate