[foreign-preview] Integrated: 8281228: Preview branch's CLinker.downcallHandle crashes inside asm

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Feb 4 13:08:37 UTC 2022


On Thu, 3 Feb 2022 22:23:47 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: e1aa60af
Author:    Maurizio Cimadamore <mcimadamore at openjdk.org>
URL:       https://git.openjdk.java.net/panama-foreign/commit/e1aa60af00cc4eac00ae0c52ec9aa2aa24002f6a
Stats:     53 lines in 3 files changed: 26 ins; 0 del; 27 mod

8281228: Preview branch's CLinker.downcallHandle crashes inside asm

Reviewed-by: sundar, jvernee

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/638


More information about the panama-dev mailing list