gh-135106: [crash repro] Randomly deposit objects in _Py_Dealloc#135589
gh-135106: [crash repro] Randomly deposit objects in _Py_Dealloc#135589colesbury wants to merge 3 commits intopython:mainfrom
_Py_Dealloc#135589Conversation
Returns `1` a little less than 1% of the time in _Py_RecursionLimit_GetMargin() to force the use of the trashcan mechanism.
1 in _Py_RecursionLimit_GetMargin1 in _Py_RecursionLimit_GetMargin
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
I don't think this shows anything more than that randomly changing the stack limit causes crashes. The trashcan mechanism relies on the margin being larger for frames higher up the call stack. This breaks that invariant. You could try changing |
f0ef510 to
92e82ac
Compare
This comment was marked as resolved.
This comment was marked as resolved.
1 in _Py_RecursionLimit_GetMargin_Py_Dealloc
da82cbb to
7c86a25
Compare
The only thing that matters here is the condition to deposit objects -- there's no invariant to be broken. I've updated the test to make that more clear. It should always be safe to deposit an object conservatively (i.e., to treat the available stack as smaller). Here's the equivalent test with the old trashcan behavior, which works without crashing: |
Returns
1a little less than 1% of the time in_Py_RecursionLimit_GetMargin() to force the use of the trashcan mechanism.
This isn't intended to be merged. It's just to:
test_weakref.test_threaded_weak_key_dict_deepcopycrash: merged objects should have ob_tid == 0 #135106