[foreign-preview] RFR: 8281228: Preview branch's CLinker.downcallHandle crashes inside asm
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Fri Feb 4 10:46:47 UTC 2022
This patch addresses a low level crash occuring in the ASM library, triggered by the new binding specialization logic. After some debugging I realized that there was no real "bug", but something subtle that we missed during review. The binding specializer uses an internal operand stack to keep track of the types maniupulated when processing ABI bindings. Most of the "pop" operation on this stack were done inside an `assert` statement, which meant that the pop operation would not be executed when running without `-esa`. Unfortunately this issue was not caught because the makefile always runs tests with assertions enabled.
After fixing this, I have also verified that the existing test (if ran without assertion enabled) would indeed have been enough to trigger the failure; in other words, the failure has not been detected because of *the way* in which tests were ran, and not because we were lacking in test coverage (for instance, TestDowncall showed 812 failures without the fix). For these reasons I did not include any test in the fix.
-------------
Commit messages:
- Revert frame parameters; fix whitespaces
- Fix stack popping in assert code
Changes: https://git.openjdk.java.net/panama-foreign/pull/638/files
Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=638&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8281228
Stats: 45 lines in 1 file changed: 23 ins; 0 del; 22 mod
Patch: https://git.openjdk.java.net/panama-foreign/pull/638.diff
Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/638/head:pull/638
PR: https://git.openjdk.java.net/panama-foreign/pull/638
More information about the panama-dev
mailing list