[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-10-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Perhaps in debug builds the memory apis should verify consistency and matching useage. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-10-19 Thread STINNER Victor
STINNER Victor added the comment: Kristján Valur Jónsson added the comment: Perhaps in debug builds the memory apis should verify consistency and matching useage. Python does check usage of apis in debug mode. Memory allocation failure are almost never checked. See my pyfailmalloc module for

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-10-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6c9050ad1afc by Victor Stinner in branch 'default': Issue #16742: My fix on PyOS_StdioReadline() was incomplete, PyMem_FREE() was http://hg.python.org/cpython/rev/6c9050ad1afc -- ___ Python tracker

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-10-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 98dbe677dfe7 by Victor Stinner in branch 'default': Close #16742: Fix misuse of memory allocations in PyOS_Readline() http://hg.python.org/cpython/rev/98dbe677dfe7 -- nosy: +python-dev resolution: - fixed stage: needs patch -

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-06-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- dependencies: +API for setting the memory allocator used by Python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-06-14 Thread STINNER Victor
STINNER Victor added the comment: Updated patch for the final API of #3329. Update also the documentation. PyOS_ReadlineFunctionPointer must now use PyMem_RawMalloc() or PyMem_RawRealloc(), instead of PyMem_Malloc() or PyMem_Realloc(). -- Added file:

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-06-13 Thread STINNER Victor
STINNER Victor added the comment: I just found the readline/GIL issue while working on #18203. I created #18205 but then I found this issue. I just closed #18205 as a duplicate. Here is a patch for Python 3.4. -- Copy of the initial message (msg191089): The callback

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-06-13 Thread STINNER Victor
STINNER Victor added the comment: See the following thread on python-dev, the root problem is that PyMem_Malloc() cannot be called with the GIL held. This is a bug in my opinion, and it should be fixed. http://mail.python.org/pipermail/python-dev/2013-June/126822.html --

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-05-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: My quick and dirty fix is simple: _PyOS_ReadlineTState = PyThreadState_GET(); /* CCP change, cannot release the GIL here because PyOS_StdioReadline uses * the regular MALLOC */ /* Py_BEGIN_ALLOW_THREADS */ #ifdef

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-05-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: So, could you propose a patch? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2013-01-02 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___ Python-bugs-list

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2012-12-25 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- nosy: +kristjan.jonsson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___ ___

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2012-12-23 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- nosy: +gregory.p.smith priority: normal - critical ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16742 ___

[issue16742] PyOS_Readline drops GIL and calls PyOS_StdioReadline, which isn't thread safe

2012-12-21 Thread Trent Nelson
New submission from Trent Nelson: Relevant thread: http://mail.python.org/pipermail/python-dev/2012-December/123225.html PyOS_StdioReadline features numerous calls that require the GIL to be held. Ideally, the GIL drop-take should be moved closer to the actual underlying read system call.