[issue37906] FreeBSD: test_threading: test_recursion_limit() crash with SIGSEGV and create a coredump

STINNER Victor report at bugs.python.org
Wed Aug 21 09:06:16 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

The crash start to occur with a Python callstack depth larger than 750. It doesn't crash with setrecursionlimit(750). See attached stack.py. Example:

vstinner at freebsd$ ./python stack.py 750 10240
setrecursionlimit(750)
stack_size: 10240.0 kiB = 10.0 MiB
end of main thread

It seems like calling _thread.stack_size(s) doesn't help:

vstinner at freebsd$ ./python stack.py 1000 10240
setrecursionlimit(1000)
stack_size: 10240.0 kiB = 10.0 MiB
Segmentation fault (core dumped)

--

I see different options:

* Reduce the Python recursion limit in the test
* Find a way to increase the default thread stack size on FreeBSD
* Skip the test on FreeBSD

On macOS, configure.ac uses a stack of 8 MiB:

                # Issue #18075: the default maximum stack size (8MBytes) is too
                # small for the default recursion limit. Increase the stack size
                # to ensure that tests don't crash
                # Note: This matches the value of THREAD_STACK_SIZE in
                # thread_pthread.h
                LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"

----------
Added file: https://bugs.python.org/file48553/stack.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37906>
_______________________________________


More information about the Python-bugs-list mailing list