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 Natanael Copa
Recipients Natanael Copa
Date 2017-12-13.17:46:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513187194.31.0.213398074469.issue32307@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2017-12-13 17:46:34Natanael Copasetrecipients: + Natanael Copa
2017-12-13 17:46:34Natanael Copasetmessageid: <1513187194.31.0.213398074469.issue32307@psf.upfronthosting.co.za>
2017-12-13 17:46:34Natanael Copalinkissue32307 messages
2017-12-13 17:46:34Natanael Copacreate