8000 GH-91079: Implement C stack limits using addresses, not counters. by markshannon · Pull Request #130007 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-91079: Implement C stack limits using addresses, not counters. #130007

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

Merged
merged 46 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fc910a3
Hide that C recursion protection is implemented with a counter. There…
markshannon Feb 10, 2025
afeb866
Implement C recursion protection with limit pointers
markshannon Feb 11, 2025
22ca169
Use uintptr_t instead of char * to avoid warnings and UB
markshannon Feb 11, 2025
e8d8c4b
Merge branch 'main' into c-recursion-limit
markshannon Feb 11, 2025
b3638a5
Fix typo and update stable ABI
markshannon Feb 11, 2025
774efb5
Tweak AST test numbers
markshannon Feb 11, 2025
151c88f
Improve logic handling trial C stack overflow
markshannon Feb 11, 2025
350f8ec
Remove calls to PyOS_CheckStack
markshannon Feb 11, 2025
428c46a
Up the limits for recursion tests
markshannon Feb 11, 2025
a9be141
Use deeper stack for test
markshannon Feb 12, 2025
03fc52e
Remove exceeds_recursion_limit and get_c_recursion_limit. Use platfor…
markshannon Feb 12, 2025
afac1e6
Do fewer probes when growing stack limit
markshannon Feb 12, 2025
9da904d
Tweak depths
markshannon Feb 12, 2025
a802ff6
Merge branch 'main' into c-recursion-limit
markshannon Feb 12, 2025
dbcf6f0
Perform lazy initialization of c recursion check
markshannon Feb 12, 2025
2cc3287
Post merge fixup
markshannon Feb 12, 2025
e697926
Up depth again
markshannon Feb 12, 2025
f8a9143
Drop 'failing' depth
markshannon Feb 12, 2025
7d6d77f
Add news
markshannon Feb 12, 2025
31a83dc
Increase headroom
markshannon Feb 12, 2025
47c50aa
Update test
markshannon Feb 12, 2025
495c4ea
Tweak some more thresholds and tests
markshannon Feb 12, 2025
9e0cc67
Add stack protection to parser
markshannon Feb 8000 13, 2025
857a7bb
Make tests more robust to low stacks
markshannon Feb 13, 2025
9c9326a
Improve error messages for stack overflow
markshannon Feb 13, 2025
75d3219
Merge branch 'main' into c-recursion-limit
markshannon Feb 13, 2025
3e41b46
Fix formatting
markshannon Feb 13, 2025
158401a
Halve size of WASI stack
markshannon Feb 13, 2025
c1eb229
Reduce webassembly 'stack size' by 10
markshannon Feb 13, 2025
7407d2b
Halve size of WASI stack, again
markshannon Feb 13, 2025
978b5e7
Change WASI stack back to 100k
markshannon Feb 13, 2025
7b36f59
Add many skip tests for WASI due to stack issues
markshannon Feb 13, 2025
5e5db03
Probe all pages when extending stack limits
markshannon Feb 14, 2025
82173ed
Fix compiler warnings
markshannon Feb 14, 2025
64cfd86
Use GetCurrentThreadStackLimits instead of probing with alloca
markshannon Feb 14, 2025
e52137f
Refactor a bit
markshannon Feb 14, 2025
704c336
Merge branch 'main' into c-recursion-limit
markshannon Feb 14, 2025
21366c3
Fix logic error in test
markshannon Feb 17, 2025
7761d31
Make ABI function needed for Py_TRASHCAN_BEGIN private
markshannon Feb 17, 2025
b067e3e
Move new fields to _PyThreadStateImpl to avoid any potential API brea…
markshannon Feb 17, 2025
b0e695f
Fix missing cast
markshannon Feb 17, 2025
c4cd68f
yet another missing _
markshannon Feb 17, 2025
9654790
Tidy up a bit
markshannon Feb 18, 2025
2cef96f
Restore use of exceeds_recursion_limit
markshannon Feb 18, 2025
c5d8a40
Address remaining review comments
markshannon Feb 18, 2025
33e11c8
Merge branch 'main' into c-recursion-limit
markshannon Feb 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test
  • Loading branch information
markshannon committed Feb 12, 2025
commit 47c50aa18d66a8372b2e3bb27b21b9c73bbd99a6
3 changes: 2 additions & 1 deletion Lib/test/test_fstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,8 @@ def test_mismatched_parens(self):
r"does not match opening parenthesis '\('",
["f'{a(4}'",
])
self.assertRaises(SyntaxError, eval, "f'{" + "("*500 + "}'")
self.assertRaises(SyntaxError, eval, "f'{" + "("*100 + "}'")
self.assertRaises(MemoryError, eval, "f'{" + "("*500 + "}'")

@unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
def test_fstring_nested_too_deeply(self):
Expand Down
Loading
0