diff --git a/ksp-fixtures/app/src/commonMain/kotlin/fixture/app/TypedPythonBridge.kt b/ksp-fixtures/app/src/commonMain/kotlin/fixture/app/TypedPythonBridge.kt index 1a856b27..5b621546 100644 --- a/ksp-fixtures/app/src/commonMain/kotlin/fixture/app/TypedPythonBridge.kt +++ b/ksp-fixtures/app/src/commonMain/kotlin/fixture/app/TypedPythonBridge.kt @@ -52,8 +52,10 @@ fun tpCheck(value: Double, limit: Double): Double { * wrapper unreachable -- so the token's `sys.getrefcount` is only meaningful after a JVM collection * and the cleaner have run (`TypedPythonKotlinCallTest.settledCounts`). * - * Deliberately **not** closed here: closing a `PyObject` argument inside an upcall releases its - * reference twice and crashed the test JVM (`Py_XDECREF` on the cleaner thread) -- binder issue #98. + * Not closed here, so the test also covers the cleaner path. Closing it would be equally correct: + * `close()` gives back the wrapper's one reference and the cleaner then has nothing left to release + * (`closeArgument`, `PyObjectArgumentReleaseTest`). The JVM crash once blamed on that (issue #98) came + * from a test wrapping fake addresses as owned objects, not from the binder. */ fun tpTouch(token: PyObject?): Long { TpBridgeLedger.touches += 1 diff --git a/ksp-fixtures/app/src/desktopTest/kotlin/fixture/app/TypedPythonKotlinCallTest.kt b/ksp-fixtures/app/src/desktopTest/kotlin/fixture/app/TypedPythonKotlinCallTest.kt index a1d4eec9..805106f9 100644 --- a/ksp-fixtures/app/src/desktopTest/kotlin/fixture/app/TypedPythonKotlinCallTest.kt +++ b/ksp-fixtures/app/src/desktopTest/kotlin/fixture/app/TypedPythonKotlinCallTest.kt @@ -229,14 +229,6 @@ class TypedPythonKotlinCallTest { */ @Test fun tenThousandCompiledCallsLeakNoReferenceAndNoKotlinHandle() { - // Blocked by python-multiplatform#98: when the cleaner releases the wrappers that 10,000 - // upcalls leave behind, the binder releases one reference twice and the JVM dies (SIGSEGV in - // Py_XDECREF on Cleaner-0) -- on the interpreted control as much as on the compiled loop. - // Re-enable with -Dtypedpython.leakTest=true once #98 is fixed. - assumeTrue( - "blocked by python-multiplatform#98 (binder double release on the cleaner path)", - System.getProperty("typedpython.leakTest") == "true", - ) Python3.exec( """ import gc, sys, sysconfig