Author vstinner
Recipients vstinner
Date 2019-08-21.13:06:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The crash start to occur with a Python callstack depth larger than 750. It doesn't crash with setrecursionlimit(750). See attached Example:

vstinner@freebsd$ ./python 750 10240
stack_size: 10240.0 kiB = 10.0 MiB
end of main thread

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

vstinner@freebsd$ ./python 1000 10240
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, 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"
Date User Action Args
2019-08-21 13:06:16vstinnersetrecipients: + vstinner
2019-08-21 13:06:16vstinnersetmessageid: <>
2019-08-21 13:06:16vstinnerlinkissue37906 messages
2019-08-21 13:06:15vstinnercreate