Issue 690622: test_cpickle overflows stack on MacOS9 (original) (raw)

Created on 2003-02-21 12:15 by jackjansen, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (6)
msg14765 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-02-21 12:15
Test_cpickle overflows the stack and hangs the interpreter on MacOS9. This happens in test_nonrecursive_deep(), in the dumps() call. I think there's a PyOS_CheckStack() call missing somewhere in cPickle. Also, it's probably a good idea to lower the recursion to 50 (the test passes as long as the recusrion is less than 65 deep), at least on MacOS9.
msg14766 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-02-21 19:55
Logged In: YES user_id=31435 There are no PyOS_CheckStack() calls in cPickle, and I'm not sure anyone really wants to bother adding them (cPickle is meant to be high-performance, not safe ). That test is consuming more stack frames than it used to, because each level of list pickling now bites another stack frame to call the new "batch list elements" routine. Reducing to 50 doesn't fly because cPickle's internal PY_CPICKLE_FAST_LIMIT #define happens to be 50 now, and the purpose of test_nonrecursive_deep is to be sure that non-cyclic containers get pickled OK in a "fast" pickler even if they're nested as deeply as PY_CPICKLE_FAST_LIMIT. Assigning to Guido for further cogitation on his day off .
msg14767 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-02-21 20:01
Logged In: YES user_id=6380 I agree that I'd rather not see CheckStack calls added to cPickle. But using 60 instead of 100 should work for both of you, right?
msg14768 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-02-21 20:04
Logged In: YES user_id=31435 Right, AFAICT 60 is enough to test what this is trying to test (although I'm not the "fast pickler" expert -- but I think it's clear enough). Jack, please confirm that 60 is OK for you?
msg14769 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-02-21 20:24
Logged In: YES user_id=31435 I reduced the nesting depth to 60, in Lib/test/test_cpickle.py, rev 1.14. Jack, please close this bug as Fixed if your problem goes away now.
msg14770 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-03-16 23:07
Logged In: YES user_id=45365 It passes now. Closing.
History
Date User Action Args
2022-04-10 16:07:01 admin set github: 38027
2003-02-21 12:15:42 jackjansen create