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.

Created on 2018-01-16 17:09 by Vasyl Kolomiets, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg310095 - (view) Author: Василь Коломієць (Vasyl Kolomiets) * Date: 2018-01-16 17:09
The code https://ideone.com/ctx92s works for 1 000 000. But on my PC it works only for 1024. Wen i am trting give him 1 000 000 - the Python crashes without any words: https://i.stack.imgur.com/1do06.png and in windows we can found this crash report: https://i.stack.imgur.com/nruoa.png --- so it works for low values and crashes on higher values. Buy its no bug... Than - What is it?
msg310236 - (view) Author: Василь Коломієць (Vasyl Kolomiets) * Date: 2018-01-18 12:22
sorry - wrong ideone example this one better to look: https://ideone.com/aV9Z8p
msg310245 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2018-01-18 15:05
CPython pushes a frame on the thread's stack for every Python frame. By default in Windows Python the thread's stack is allowed to grow up to about 2 MB. On Linux the default limit is 8 MB, but a higher limit can be set via `ulimit -s`. After the stack is full, pushing another value will crash the process due to a stack overflow. Windows raises a STATUS_STACK_OVERFLOW (0xC00000FD) exception. Linux raises a SIGSEGV signal (segmentation fault). The default interpreter recursion limit of 1,000 is set to raise a Python RecursionError well before you'd see a hard crash from a stack overflow. If we ballpark a C stack frame at about 1 KB in 64-bit Python, then the default stack size on Windows should support a recursion limit of about 2,000. For a recursion limit of 100,000, I would estimate a 100 MB stack size. You can call threading.stack_size(size_in_bytes) to reserve a larger stack size for new threads. However, in Python code it's better to rewrite such deeply recursive cases to use loops instead.
msg310246 - (view) Author: Василь Коломієць (Vasyl Kolomiets) * Date: 2018-01-18 15:15
Thanks a lot! Grace and Honor!
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76751
2018-01-18 15:15:23Vasyl Kolomietssetmessages: + msg310246
2018-01-18 15:05:19eryksunsetstatus: open -> closed

nosy: + eryksun
messages: + msg310245

resolution: not a bug
stage: resolved
2018-01-18 12:22:26Vasyl Kolomietssetmessages: + msg310236
2018-01-16 17:09:05Vasyl Kolomietscreate