This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-08-21.13:06:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566392776.04.0.65915593541.issue37906@roundup.psfhosted.org>
In-reply-to
Content
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@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@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"
History
Date User Action Args
2019-08-21 13:06:16vstinnersetrecipients: + vstinner
2019-08-21 13:06:16vstinnersetmessageid: <1566392776.04.0.65915593541.issue37906@roundup.psfhosted.org>
2019-08-21 13:06:16vstinnerlinkissue37906 messages
2019-08-21 13:06:15vstinnercreate