[jdk21u-dev] RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v4]
Timofei Pushkin
tpushkin at openjdk.org
Thu Sep 18 06:53:52 UTC 2025
On Wed, 17 Sep 2025 14:18:24 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Fixes a error which significantly complicates the use of static CDS in some applications with user-provided class loaders (workarounds require either manually editing the generated CDS classlist which is error-prone, or switching to dynamic CDS which has its own implications, or rewriting the application which is not always possible).
>>
>> The conflicts were trivial: a few neighboring methods missing from this version and not directly related to the change.
>>
>> The PR depends on #1833 and #1834 though it can be rewritten not to if needed.
>>
>> Testing besides the CI (performed on macos/arm64): `runtime/cds`, a minimal reproducer app described in the original bug report.
>
> Timofei Pushkin has updated the pull request incrementally with one additional commit since the last revision:
>
> Make an assert less general
I could not reproduce the issue on multiple platforms: mac-arm64, linux-arm64, linux-x64.
It probably occurs because `java/lang/invoke/BoundMethodHandle$Species_LI` gets dynamically generated sometimes which generates the warning because [JDK-8338530](https://bugs.openjdk.org/browse/JDK-8338530) is missing from JDK 21 (it removes this warning for such classes). So it is not really caused by this change itself.
Since the failing assert is actually not required to be that general by the test, I made it less general. An alternative would be to backport JDK-8338530 before integrating this — should be neither hard nor risky but that's additional work nevertheless.
@iklam Please re-approve if you agree with the provided solution.
-------------
PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1835#issuecomment-3305667223
More information about the jdk-updates-dev
mailing list