Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading