Skip to content

cvm/overlay: Fix whitebox isclassalive mismatch#138

Merged
duanyangjing merged 2 commits into
bytedance:jdk17u-target8from
duanyangjing:aime/fix-whitebox-isclassalive
May 20, 2026
Merged

cvm/overlay: Fix whitebox isclassalive mismatch#138
duanyangjing merged 2 commits into
bytedance:jdk17u-target8from
duanyangjing:aime/fix-whitebox-isclassalive

Conversation

@duanyangjing
Copy link
Copy Markdown
Collaborator

Based on JDK 8 baseline, this PR fixes the compatibility issue where the JDK 17 HotSpot native method isClassAlive0 has been changed to countAliveClasses0. The JDK 8 WhiteBox library's isClassAlive0 signature would cause an UnsatisfiedLinkError on a JDK 17 kernel.

This fix enables 9 class unloading related test cases to pass successfully on CompoundVM.

In JDK 17 hotspot, the native method isClassAlive0(String) returning boolean was replaced by countAliveClasses0(String) returning int. The JDK 8 WhiteBox test library still declares the old isClassAlive0 native signature, which causes an UnsatisfiedLinkError at runtime when running on the JDK 17 kernel.

This overlay adapts the WhiteBox class to call countAliveClasses0 and compare the result against zero, preserving the same boolean isClassAlive(String) public API contract expected by all ClassUnload and class_unloading test cases.
@duanyangjing duanyangjing merged commit 9113187 into bytedance:jdk17u-target8 May 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants