Message308226
Python assumes that the system default thread stack size is big enough for python, except for OSX and FreeBSD where stack size is explicitly set. With musl libc the system thread stack size is only 80k, which leads to hard crash before `sys.getrecursionlimit()` is hit.
See: https://github.com/python/cpython/blob/master/Python/thread_pthread.h#L22
Testcase:
import threading
import sys
def f(n=0):
try:
print(n)
f(n+1)
except Exception:
print("we hit recursion limit")
sys.exit(0)
t = threading.Thread(target=f)
t.start()
This can be pasted into:
docker run --rm -it python:2.7-alpine
docker run --rm -it python:3.6-alpine |
|
Date |
User |
Action |
Args |
2017-12-13 17:46:34 | Natanael Copa | set | recipients:
+ Natanael Copa |
2017-12-13 17:46:34 | Natanael Copa | set | messageid: <1513187194.31.0.213398074469.issue32307@psf.upfronthosting.co.za> |
2017-12-13 17:46:34 | Natanael Copa | link | issue32307 messages |
2017-12-13 17:46:34 | Natanael Copa | create | |
|