[foreign-memaccess+abi] Integrated: 8294986: Possible mismatched acquire/release in binding specializer

Jorn Vernee jvernee at openjdk.org
Tue Oct 11 16:27:10 UTC 2022


On Tue, 11 Oct 2022 14:47:31 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> We acquire sessions of address parameters before a downcall, and release them afterwards. However, if acquire fails with an exception, we still call release in the finally block.
> 
> Fixing this is a simple case of switching 2 lines: when acquire fails, we don't store the session in a local, and so the cleanup in the finally block will not call release on it either.
> 
> For testing, I doesn't seem possible to make this bug result in an error with the current code. So, I've added an assert to the implementation that checks whether release was called too many times.

This pull request has now been integrated.

Changeset: b9e9a20a
Author:    Jorn Vernee <jvernee at openjdk.org>
URL:       https://git.openjdk.org/panama-foreign/commit/b9e9a20a4e6f3d3d0f35dd35499911eca0de6893
Stats:     90 lines in 4 files changed: 82 ins; 4 del; 4 mod

8294986: Possible mismatched acquire/release in binding specializer

Reviewed-by: mcimadamore

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

PR: https://git.openjdk.org/panama-foreign/pull/739


More information about the panama-dev mailing list