Repository navigation
Fix: GeneratedTableTest wrapped fabricated addresses in owning PyObjects (JVM crash on GC) - #118
Merged
Merged
Conversation
…ged and the JVM alive (#98)
…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).
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.