You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
infinite loop in PyRun_InteractiveLoopFlags() #74881
To reproduce the problem, apply the nomemory_allocator.patch from issue 30695 and run the following two statements that must be interrupted with ^C:
$ ./python -q
>>> import _testcapi
>>> _testcapi.set_nomemory_allocator()
sys.excepthook is missing
^Cpython: Objects/call.c:785: PyEval_CallObjectWithKeywords: Assertion `!PyErr_Occurred()' failed.
Aborted (core dumped)
The attached patch fixes this problem.
No PR for the moment: this patch and nomemory_allocator.patch are needed to demonstrate other issues.
_testcapi.set_nomemory() does not exist on Pyhton 2.7 so the changes cannot be tested. Applying the changes to PyRun_InteractiveLoopFlags() in 2.7 looks rather straightforward but there are too many differences in PyRun_InteractiveOneFlags() between 2.7 and 3.7.
xdegaye commented on Nov 13, 2017
xdegayemannequin
MannequinAuthor
More actions
Also the existing test coverage of these functions in all the Python versions is very weak.
Activity
xdegaye commentedon Jun 18, 2017
To reproduce the problem, apply the nomemory_allocator.patch from issue 30695 and run the following two statements that must be interrupted with ^C: $ ./python -q >>> import _testcapi >>> _testcapi.set_nomemory_allocator() sys.excepthook is missing ^Cpython: Objects/call.c:785: PyEval_CallObjectWithKeywords: Assertion `!PyErr_Occurred()' failed. Aborted (core dumped)The attached patch fixes this problem.
No PR for the moment: this patch and nomemory_allocator.patch are needed to demonstrate other issues.
xdegaye commentedon Jun 19, 2017
The patch is far too simplistic. With this patch an exception kills the interactive loop, for example:
vstinner commentedon Jun 19, 2017
See also my old issue bpo-8070 opened 7 years ago :-)
xdegaye commentedon Nov 12, 2017
New changeset e0582a3 by xdegaye in branch 'master':
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160)
e0582a3
xdegaye commentedon Nov 12, 2017
New changeset ea5b545 by xdegaye in branch '3.6':
[3.6] bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160). (bpo-4379)
ea5b545
vstinner commentedon Nov 13, 2017
Thanks for fixing this very old bug!
What about Python 2.7?
xdegaye commentedon Nov 13, 2017
_testcapi.set_nomemory() does not exist on Pyhton 2.7 so the changes cannot be tested. Applying the changes to PyRun_InteractiveLoopFlags() in 2.7 looks rather straightforward but there are too many differences in PyRun_InteractiveOneFlags() between 2.7 and 3.7.
xdegaye commentedon Nov 13, 2017
Also the existing test coverage of these functions in all the Python versions is very weak.
vstinner commentedon Nov 13, 2017
Ok, I understand, thanks for the explanation.