Skip to content
Snippets Groups Projects
Commit 2d4fbfb1 authored by Stefano Rivera's avatar Stefano Rivera
Browse files

Patch: Avoid embedded bootstrapping race in recent python2.7 (Closes: #889813)

parent fc4409a6
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@ python-cffi (1.11.4-1) UNRELEASED; urgency=medium
* Bump Standards-Version to 4.1.3, no changes needed.
* Declare Rules-Requires-Root: no
* Bump debhelper compat to 11.
* Patch: Avoid embedded bootstrapping race in recent python2.7
(Closes: #889813)
[ Ondřej Nový ]
* d/control: Set Vcs-* to salsa.debian.org
......
From: Stefano Rivera <stefanor@debian.org>
Date: Tue, 20 Feb 2018 07:54:32 -0800
Subject: Bootstrap embedded interpreter with py3k logic
2.7 recently started releasing the GIL during Py_InitializeEx, which
allowed races in the embedded bootstrapping. Hold a lock while
initializing, to avoid this.
Bug-Debian: https://bugs.debian.org/889813
Bug-Upstream: https://bitbucket.org/cffi/cffi/issues/358/segfaults-in-testing-embedding
---
cffi/_embedding.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cffi/_embedding.h b/cffi/_embedding.h
index 2b744df..4d30dd7 100644
--- a/cffi/_embedding.h
+++ b/cffi/_embedding.h
@@ -332,7 +332,7 @@ static int _cffi_carefully_make_gil(void)
}
#endif
-#if PY_MAJOR_VERSION >= 3
+#if 1
/* Python 3: call Py_InitializeEx() */
{
PyGILState_STATE state = PyGILState_UNLOCKED;
avoid-2.7-bootstrap-race
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment