Skip to content

Fix: GeneratedTableTest wrapped fabricated addresses in owning PyObjects (JVM crash on GC) - #118

Merged
b-re-w merged 3 commits into
developfrom
feat/binder-double-free
Oct 3, 2026
Merged

b-re-w merged 3 commits into
developfrom
feat/binder-double-free

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Closes #98

Root cause: not the binder. GeneratedTableTest built PyObject(0xAAAA/0xBBBB, borrowed=false); the first GC afterwards ran Py_DecRef(0xAAAA) on the Cleaner thread (hs_err: si_addr 0xaaaa, Py_XDECREF <- topLevelDecRefAction). Upcall-path ownership was audited site by site and is correct (30,000 upcalls: refcount delta 0; close() + Cleaner never double-release).
Defect fixed: the test now uses two real object() instances.
Test added: PyObjectArgumentReleaseTest — child JVM, 10,000 PyObject-argument upcalls (cleaner path and close-inside path), GC until refcount returns, sentinel; asserts exit 0, refcount before == after, HandleTable delta 0. Red with the old GeneratedTableTest body: both fail (child crash).
Verification (coordinator, after merging develop, separate modules): plugin 271/0, desktopTest 597/0, ksp artifact 35/0, app 79/0, compose 116/0, androidNative OK.
Not verified here: #102's leak test re-enabled (the -D flag on the Gradle CLI may not reach the test JVM); TypedPython follows up. Suspected HandleTable/GIL race filed as #117.

b-re-w added 3 commits October 3, 2026 19:44
…ng PyObjects (#98)

The traverse proof built PyObject(0xAAAA, borrowed=false); the first GC after it ran
Py_DecRef(0xAAAA) on the Cleaner thread and killed the JVM (hs_err: si_addr 0xaaaa,
Py_XDECREF <- topLevelDecRefAction). The upcall path's ownership is correct: it now uses two
real object() instances (new references, borrowed=false).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant