Skip to content

[FFI/Jtreg] Validate the downcall function address in JDK20 - #17074

Merged
tajila merged 1 commit into
eclipse-openj9:masterfrom
ChengJin01:ffi_jtreg_liblookuptest_scope_check
Mar 31, 2023
Merged

[FFI/Jtreg] Validate the downcall function address in JDK20#17074
tajila merged 1 commit into
eclipse-openj9:masterfrom
ChengJin01:ffi_jtreg_liblookuptest_scope_check

Conversation

@ChengJin01

Copy link
Copy Markdown

The changes check the life cycle of the surrounding scope of the downcall
function address to guarantee the validity of the scope during the downcall.

Fixes: #17062

Signed-off-by: ChengJin01 jincheng@ca.ibm.com

The changes check the life cycle of the surrounding scope
of the downcall function address to guarantee the validity
of the scope during the downcall.

Fixes: eclipse-openj9#17062

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
@ChengJin01

Copy link
Copy Markdown
Author

Note:
[1] The PR refactored the code for the validity check on the scope to void duplicate code everywhere to throw the exception.
[2] The changes are verified in OpenJ9 FFI test suites plus the related Jtreg test suites in JDK17/19/20.

@ChengJin01

Copy link
Copy Markdown
Author

Reviewer: @tajila
FYI: @pshipton

@ChengJin01
ChengJin01 requested a review from tajila March 30, 2023 16:09
@ChengJin01 ChengJin01 added comp:vm project:panama Used to track Project Panama related work jdk20 labels Mar 30, 2023
@tajila

tajila commented Mar 30, 2023

Copy link
Copy Markdown
Contributor

jenkins test sanity,openjdk.sanity plinux jdk20

@ChengJin01

ChengJin01 commented Mar 30, 2023

Copy link
Copy Markdown
Author

https://openj9-jenkins.osuosl.org/job/Test_openjdk20_j9_openjdk.sanity_ppc64le_linux_Personal/1/console

16:07:58  Error: cannot find the following tests: openjdk.sanity 
(note: group target such as sanity is not accepted inside testList)
16:07:58  
16:07:58  makeGen.mk:45: recipe for target 'autogen' failed
16:07:58  make[1]: *** [autogen] Error 1
16:07:58  make[1]: Leaving directory '/home/jenkins/workspace/Test_openjdk20_j9_openjdk.sanity_ppc64le_linux_Personal/aqa-tests/TKG'
16:07:58  makefile:49: recipe for target '_openjdk.sanity' failed
16:07:58  make: *** [_openjdk.sanity] Error 2

It seems the failure was caused by the incorrect setting in the test job at #17074 (comment).

@tajila

tajila commented Mar 31, 2023

Copy link
Copy Markdown
Contributor

jenkins test sanity.openjdk plinux jdk20

@tajila
tajila merged commit e656d2e into eclipse-openj9:master Mar 31, 2023
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this pull request Jun 5, 2023
The changes rework the previous fix at
eclipse-openj9#17074
by performing the scope check before returning the valid
downcall address in invokeNative() to avoid any timing
issue with the downcall address.

Note:
The scope check is only intended for JDK20+ as explained
at eclipse-openj9#17062.

Fixes: eclipse-openj9#17524

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this pull request Jun 5, 2023
The changes rework the previous fix at
eclipse-openj9#17074
by performing the scope check before returning the valid
downcall address in invokeNative() to avoid any timing
issue with the downcall address.

Note:
The scope check is only intended for JDK20+ as explained
at eclipse-openj9#17062.

Fixes: eclipse-openj9#17524

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
ChengJin01 pushed a commit to ChengJin01/openj9 that referenced this pull request Jun 6, 2023
The changes rework the previous fix at
eclipse-openj9#17074
by performing the scope check before returning the valid
downcall address in invokeNative() to avoid any timing
issue with the downcall address.

Note:
The scope check is only intended for JDK20+ as explained
at eclipse-openj9#17062.

Fixes: eclipse-openj9#17524

Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:vm jdk20 project:panama Used to track Project Panama related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JDK20/FFI_Jtreg] Crash detected in LibraryLookupTest

2 participants