8000 gh-135106: [crash repro] Randomly deposit objects in `_Py_Dealloc` by colesbury · Pull Request #135589 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-135106: [crash repro] Randomly deposit objects in _Py_Dealloc #135589

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
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 Include/internal/pycore_pystate.h
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
  • Loading branch information
colesbury and AA-Turner authored Jun 16, 2025
commit 92e82acb1be29b7d0169f31d8cbc66293ca6a137
6 changes: 3 additions & 3 deletions Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ _Py_RecursionLimit_GetMargin(PyThreadState *tstate)

// splitmix64 from https://prng.di.unimi.it/splitmix64.c
uint64_t z = (tstate->prng += 0x9e3779b97f4a7c15);
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
z = (z ^ (z >> 27)) * 0x94d049bb133111eb;
uint64_t r = z ^ (z >> 31);
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
z = (z ^ (z >> 27)) * 0x94d049bb133111eb;
uint64_t r = z ^ (z >> 31);
if ((r & 0xFF) < 2) { // 2/256 chance = ~ 0.8% chance
return 1;
}
Expand Down
Loading
0