
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-03-14 22:52 byvstinner, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| pymem_gil.patch | vstinner,2016-03-14 22:52 | review | ||
| Messages (11) | |||
|---|---|---|---|
| msg261787 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-03-14 22:52 | |
With the issue#26558, debug hooks of PyObject_Malloc() now checks that the GIL is hold.I left PyMem_Malloc() unchanged, because I am not 100% sure that it's ok yet to implement the same check in PyMem_Malloc(). So I opened this issue.Python 3 doc explicitly asks that the GIL is hold to call PyMem_Malloc():https://docs.python.org/dev/c-api/memory.html#memory-interfacePython 2 doc doesn't say anything about the GIL:https://docs.python.org/2/c-api/memory.html#memory-interfaceUsually, functions prefixed by "Py" require the GIL to be hold.In practice, currently PyMem_Malloc() is implemented with malloc() which is thread-safe.In the issue#26249, I tested numpy, lxml, Pillow and cryptography with all debug hooks enabled, including GIL checks in PyMem_Malloc() and PyObject_Malloc(). I only found one bug in numpy:https://github.com/numpy/numpy/pull/7404Attached patch changes debug hooks on PyMem_Malloc() to ensure that the GIL is hold. | |||
| msg261850 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-16 11:17 | |
New changeset58644086c195 by Victor Stinner in branch 'default':Fail if PyMem_Malloc() is called without holding the GILhttps://hg.python.org/cpython/rev/58644086c195 | |||
| msg261851 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-03-16 11:17 | |
I pushed the patch (I added an unit test).If too many users complain, we can revert the change since it's now a small change. | |||
| msg261854 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-16 14:36 | |
New changesetae76a1046bb9 by Victor Stinner in branch 'default':Fix usage of PyMem_Malloc() in os.stat()https://hg.python.org/cpython/rev/ae76a1046bb9 | |||
| msg261865 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-16 22:21 | |
New changeset5b4f173f0690 by Victor Stinner in branch 'default':faulthandler now works in non-Python threadshttps://hg.python.org/cpython/rev/5b4f173f0690New changesetd6d64168ee8c by Victor Stinner in branch 'default':Py_FatalError: disable faulthandler earlierhttps://hg.python.org/cpython/rev/d6d64168ee8c | |||
| msg261866 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-16 22:27 | |
New changeset959e58cfbde9 by Victor Stinner in branch 'default':Fix usage of PyMem_Malloc() in overlapped.chttps://hg.python.org/cpython/rev/959e58cfbde9 | |||
| msg261867 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-16 22:45 | |
New changeset73d8adc0d5ea by Victor Stinner in branch '3.5':Fix usage of PyMem_Malloc() in overlapped.chttps://hg.python.org/cpython/rev/73d8adc0d5ea | |||
| msg261874 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-03-17 00:43 | |
Reopen. I found and fixed two bugs in os and _overlapped modules (_overlapped is used by asyncio on Windows). | |||
| msg261875 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-17 00:46 | |
New changesetce62df22f3bf by Victor Stinner in branch '3.5':Py_FatalError: disable faulthandler earlierhttps://hg.python.org/cpython/rev/ce62df22f3bf | |||
| msg261902 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2016-03-17 08:19 | |
Hum ok, all buildbots look to be happy again :-) I close the issue (again). | |||
| msg261954 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-03-18 10:04 | |
New changeset7b079adb0774 by Victor Stinner in branch 'default':Enhance documentation on malloc debug hookshttps://hg.python.org/cpython/rev/7b079adb0774 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:28 | admin | set | github: 70750 |
| 2016-03-18 10:04:44 | python-dev | set | messages: +msg261954 |
| 2016-03-17 08:20:02 | vstinner | set | status: open -> closed resolution: fixed |
| 2016-03-17 08:19:56 | vstinner | set | messages: +msg261902 |
| 2016-03-17 00:46:28 | python-dev | set | messages: +msg261875 |
| 2016-03-17 00:43:33 | vstinner | set | status: closed -> open resolution: fixed -> (no value) messages: +msg261874 |
| 2016-03-16 22:45:40 | python-dev | set | messages: +msg261867 |
| 2016-03-16 22:27:39 | python-dev | set | messages: +msg261866 |
| 2016-03-16 22:21:23 | python-dev | set | messages: +msg261865 |
| 2016-03-16 14:36:17 | python-dev | set | messages: +msg261854 |
| 2016-03-16 11:17:47 | vstinner | set | status: open -> closed resolution: fixed messages: +msg261851 |
| 2016-03-16 11:17:03 | python-dev | set | nosy: +python-dev messages: +msg261850 |
| 2016-03-14 22:54:38 | vstinner | set | title: PyMem_Malloc(): check that the GIL is held in debug hooks -> PyMem_Malloc(): check that the GIL is hold in debug hooks |
| 2016-03-14 22:52:53 | vstinner | create | |