New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Recover From StackOverflow in 3.9 Tests #89964
Comments
In bpo-30570, David Bolen noticed that "py -3.9 -m test test_pickle" consistently crashes on Windows (even though other methods of running that test do not crash, and the test succeeds when failed tests are retried). Curiously, it seems that adding using support.infinite_recursion *introduced* the crash rather than preventing it. I'm guessing this would have been fixed by #68689, but that fix was rolled back in #69366 for the sake of 3.9 ABI compatibility. As of now, 3.9's pycore_ceval.c reads: static inline int _Py_RecursionLimitLowerWaterMark(int limit) {
if (limit > 200) {
return (limit - 50);
}
else {
return (3 * (limit >> 2));
}
} But support.infinite_recursion(max_depth=75) has a default 75, leaving a "low-water-mark" of 54, which the recursion apparently never recovers back to in the right way. A couple of solutions could fix this: (1) Remove the usage of support.infinite_recursion at the test.pickletester.AbstractPickleTests.test_bad_getattr call site. (2) Use a different value max_depth. On my machine at least, it seems 75 was a "perfect storm" to cause this issue. Using infinite_recursion(60) or 61 or ... or 74 or 76 or 77 or 78 all pass, but infinite_recursion(75) in particular fails. (3) Use fewer calls after the overflow by inlining something like assertRaises: with support.infinite_recursion():
- self.assertRaises(RuntimeError, self.dumps, x, proto)
+ try:
+ self.dumps(x, proto)
+ except RuntimeError:
+ pass
+ else:
+ self.fail("RuntimeError not raised") (5) Re-visit an ABI-compliant version of #68689, such as #69347 The output I keep getting without any changes:
Current thread 0x000028b0 (most recent call first): |
I'll note that it also fails on first run on the Windows 11 builder: |
Thanks! ✨ 🍰 ✨ |
Should this be backported to make the 3.8 Buildbots happy? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: