From f3b03fff6def9f5240803333b9aac7ec316fa30c Mon Sep 17 00:00:00 2001 From: Konstantin Leontev Date: Wed, 30 Aug 2023 11:23:45 +0100 Subject: [PATCH] [bos #37406][CEA] Fixed segfault in YACS_YacsRuntimeTest on UB22,FD36 and FD37 by acquiring and releasing the GIL. --- src/runtime/Test/runtimeTest.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/Test/runtimeTest.cxx b/src/runtime/Test/runtimeTest.cxx index 01fa8b123..f48e04418 100644 --- a/src/runtime/Test/runtimeTest.cxx +++ b/src/runtime/Test/runtimeTest.cxx @@ -1400,8 +1400,12 @@ void RuntimeTest::convertPorts() cAny <<= (CORBA::Double) d0; break; case 2: + { + PyGILState_STATE gstate = PyGILState_Ensure(); v = pAny = PyFloat_FromDouble(d0); + PyGILState_Release(gstate); break; + } case 3: { ostringstream os; @@ -1484,8 +1488,12 @@ void RuntimeTest::convertPorts() vAny->decrRef(); break; case 2: - Py_DECREF(pAny); + { + PyGILState_STATE gstate = PyGILState_Ensure(); + Py_XDECREF(pAny); + PyGILState_Release(gstate); break; + } default: break; } -- 2.30.2