Skip to content

Commit 2c0d99b

Browse files
committed
Make stack check handle sanitizers better
1 parent 8933b26 commit 2c0d99b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Include/pythonrun.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ PyAPI_DATA(int) (*PyOS_InputHook)(void);
2525
* no two calls to check recursion depth are more than this far
2626
* apart. In practice, that means it must be larger than the C
2727
* stack consumption of PyEval_EvalDefault */
28-
#if defined(Py_DEBUG) && defined(WIN32)
28+
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
29+
# define PYOS_STACK_MARGIN 4096
30+
#elif defined(Py_DEBUG) && defined(WIN32)
2931
# define PYOS_STACK_MARGIN 3072
3032
#else
3133
# define PYOS_STACK_MARGIN 2048

Lib/test/test_functools.py

+1
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def test_setstate_subclasses(self):
404404
self.assertEqual(r, ((1, 2), {}))
405405
self.assertIs(type(r[0]), tuple)
406406

407+
@support.skip_if_sanitizer("thread sanitizer crashes in __tsan::FuncEntry", thread=True)
407408
@support.skip_emscripten_stack_overflow()
408409
def test_recursive_pickle(self):
409410
with replaced_module('functools', self.module):

0 commit comments

Comments
 (0)