[foreign-memaccess+abi] RFR: 8294986: Possible mismatched acquire/release in binding specializer [v2]
Jorn Vernee
jvernee at openjdk.org
Tue Oct 11 15:54:41 UTC 2022
> 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.
Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
don't use assert
-------------
Changes:
- all: https://git.openjdk.org/panama-foreign/pull/739/files
- new: https://git.openjdk.org/panama-foreign/pull/739/files/1c372780..21407c1c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=panama-foreign&pr=739&range=01
- incr: https://webrevs.openjdk.org/?repo=panama-foreign&pr=739&range=00-01
Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/panama-foreign/pull/739.diff
Fetch: git fetch https://git.openjdk.org/panama-foreign pull/739/head:pull/739
PR: https://git.openjdk.org/panama-foreign/pull/739
More information about the panama-dev
mailing list