STINNER Victor added the comment: stack_overflow_28870-sp.py: script using testcapi_stack_pointer.patch to compute the usage of the C stack. Results of this script.
(*) Reference test_python_call: 7175 calls before crash, stack: 1168 bytes/call test_python_getitem: 6235 calls before crash, stack: 1344 bytes/call test_python_iterator: 5344 calls before crash, stack: 1568 bytes/call => total: 18754 calls, 4080 bytes (1) no_small_stack.patch test_python_call: 7175 calls before crash, stack: 1168 bytes/call test_python_getitem: 6547 calls before crash, stack: 1280 bytes/call test_python_iterator: 5572 calls before crash, stack: 1504 bytes/call => total: 19294 calls, 3952 bytes test_python_call is clearly not impacted by no_small_stack.patch. test_python_call loops on method_call(): method_call() => _PyObject_Call_Prepend() => _PyObject_FastCallDict() => _PyFunction_FastCallDict() => _PyEval_EvalCodeWithName() => PyEval_EvalFrameEx() => _PyEval_EvalFrameDefault() => call_function() => _PyObject_FastCallKeywords() => slot_tp_call() => PyObject_Call() => method_call() => (...) _PyObject_Call_Prepend() is in the middle of the chain. This function uses a "small stack" of _PY_FASTCALL_SMALL_STACK "PyObject*" items. We can clearly see the impact of modifying _PY_FASTCALL_SMALL_STACK on the maximum number of test_python_call calls before crash in msg285057. ---------- Added file: http://bugs.python.org/file46239/stack_overflow_28870-sp.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28870> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com