We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1b4f96 commit 5dadae5Copy full SHA for 5dadae5
Python/ceval.c
@@ -373,7 +373,12 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
373
if (err == 0) {
374
uintptr_t base = ((uintptr_t)stack_addr) + guard_size;
375
_tstate->c_stack_top = base + stack_size;
376
+#ifdef _Py_THREAD_SANITIZER
377
+ // Thread sanitizer crashes if we use a bit more than half the stack.
378
+ _tstate->c_stack_soft_limit = base + (stack_size / 2);
379
+#else
380
_tstate->c_stack_soft_limit = base + PYOS_STACK_MARGIN_BYTES * 2;
381
+#endif
382
_tstate->c_stack_hard_limit = base + PYOS_STACK_MARGIN_BYTES;
383
assert(_tstate->c_stack_soft_limit < here_addr);
384
assert(here_addr < _tstate->c_stack_top);
0 commit comments