classification
Title: [2.7] Make PyMem_Malloc() thread-safe in debug mode
Type: Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gregory.p.smith, vstinner
Priority: normal Keywords: patch

Created on 2018-11-30 23:07 by vstinner, last changed 2018-12-18 01:12 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10828 merged vstinner, 2018-11-30 23:09
PR 10866 closed vstinner, 2018-12-03 11:45
Messages (4)
msg330833 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-30 23:07
While fixing bpo-33015, I discovered that PyMem_Malloc() isn't thread-safe when Python is compiled in debug mode:
https://bugs.python.org/issue33015#msg330806

I wrote PR 10828 to make PyMem_Malloc() thread-safe when Python is compiled in debug mode.
msg330937 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-03 11:29
New changeset c275be54411d425c90e7c679ddb5321ba458f61d by Victor Stinner in branch '2.7':
bpo-35368: Make PyMem_Malloc() thread-safe in debug mode (GH-10828)
https://github.com/python/cpython/commit/c275be54411d425c90e7c679ddb5321ba458f61d
msg330958 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-03 16:45
According to bpo-31473, the debug hook on PyMem_Malloc() is not thread-safe: 'serialno' variable is not protected by any lock and it's not atomic.
msg332036 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-12-18 01:12
Let's continue discussion on serialno atomicity on bpo-31473.
History
Date User Action Args
2018-12-18 01:12:54vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg332036

stage: patch review -> resolved
2018-12-03 16:45:17vstinnersetmessages: + msg330958
2018-12-03 11:45:56vstinnersetpull_requests: + pull_request10102
2018-12-03 11:29:31vstinnersetmessages: + msg330937
2018-11-30 23:09:40vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request10076
2018-11-30 23:07:48vstinnercreate