[issue28858] Fastcall uses more C stack

2016-12-05 Thread STINNER Victor
STINNER Victor added the comment: The changeset 4171cc26272c "Remove _PyObject_CallArg1() macro" fixed the initial bug report, so I now close the issue. Serhiy: If you see further enhancements, please open a new issue. Your second stack_overflow.py script is interesting, but I don't see any

[issue28858] Fastcall uses more C stack

2016-12-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4171cc26272c by Victor Stinner in branch 'default': Issue #28858: Remove _PyObject_CallArg1() macro https://hg.python.org/cpython/rev/4171cc26272c -- ___ Python tracker

[issue28858] Fastcall uses more C stack

2016-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That was my initial preference. Mainly because this doesn't add code churn. But I don't understand how PyObject_CallFunctionObjArgs() that uses _PyObject_CallArg1() and has many local variables can consume less stack than _PyObject_CallArg1() itself.

[issue28858] Fastcall uses more C stack

2016-12-04 Thread STINNER Victor
STINNER Victor added the comment: When I wrote the _PyObject_CallArg1(), it looks as a cool hack: #define _PyObject_CallArg1(func, arg) \ _PyObject_FastCall((func), (PyObject **)&(arg), 1) It hacks the declaration of an explicit "stack" like: PyObject *stack[1]; stack[0] = arg;

[issue28858] Fastcall uses more C stack

2016-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor. Following script includes several examples of achieving a stack overflow (most are real world examples or can be used in real world examples). It measures maximal deep for every type of recursion. -- Added file:

[issue28858] Fastcall uses more C stack

2016-12-04 Thread STINNER Victor
STINNER Victor added the comment: > Serhiy Storchaka reported that Python 3.6 crashs earlier than Python 3.5 on > calling json.dumps() when sys.setrecursionlimit() is increased. Reference: http://bugs.python.org/issue23507#msg282190 (issue #23507). Serhiy Storchaka: "Yes, that is why I asked

[issue28858] Fastcall uses more C stack

2016-12-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset d35fc6e58a70 by Victor Stinner in branch 'default': Backed out changeset b9c9691c72c5 https://hg.python.org/cpython/rev/d35fc6e58a70 -- nosy: +python-dev ___ Python tracker

[issue28858] Fastcall uses more C stack

2016-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, that is why I asked you to revert your changes. In additional, they introduced compiler warnings. -- ___ Python tracker

[issue28858] Fastcall uses more C stack

2016-12-02 Thread STINNER Victor
STINNER Victor added the comment: Oh, I didn't understand that the regression was introduced by the revision b9c9691c72c5. The purpose of this revision was to *reduce* the memory usage of the C stack!? It seems like _PyObject_CallArg1() uses more stack memory than

[issue28858] Fastcall uses more C stack

2016-12-01 Thread STINNER Victor
New submission from STINNER Victor: Serhiy Storchaka reported that Python 3.6 crashs earlier than Python 3.5 on calling json.dumps() when sys.setrecursionlimit() is increased. I tested the script he wrote. Results on Python built in release mode: Python 3.7: ... 58100 116204 Segmentation