RFR: 8349944: [JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe [v2]

Nicole Xu duke at openjdk.org
Wed Feb 26 07:25:04 UTC 2025


On Fri, 21 Feb 2025 07:01:42 GMT, Nicole Xu <duke at openjdk.org> wrote:

>> The UnsafeOps JMH benchmark fails with the following error:
>> 
>>       ```
>>       java.lang.IllegalAccessError: class org.openjdk.bench.sun.misc.UnsafeOps (in unnamed module @0x520a3426) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0x520a3426
>>       ```
>> 
>> Since this micro-benchmark is created for `sun.misc.Unsafe` rather than
>> `jdk.internal.misc.Unsafe`, we change it back as before JDK-8332744.
>> 
>> Note that even it will raise "proprietary API" warnings after this
>> patch, it is acceptable because the relevant APIs are bound for removal
>> for the integrity of the platform.
>
> Nicole Xu has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - 8349944: [JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe
>    
>    The UnsafeOps JMH benchmark fails with the following error:
>    
>          ```
>          java.lang.IllegalAccessError: class org.openjdk.bench.sun.misc.UnsafeOps (in unnamed module @0x520a3426) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0x520a3426
>          ```
>    
>    Since this micro-benchmark is created for `sun.misc.Unsafe` rather than
>    `jdk.internal.misc.Unsafe`, we change it back as before JDK-8332744.
>    
>    Note that even it will raise "proprietary API" warnings after this
>    patch, it is acceptable because the relevant APIs are bound for removal
>    for the integrity of the platform.
>    
>    Change-Id: Ia7c57c2ca09af4b2b3c6cc10ef4ae5a9f3c38a4c
>  - Revert "8349944: [JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe"
>    
>    This reverts commit ebc32ae2c6e448075fedbdbb2b4879c43829c44b.

Hi @cushon , I've prepared a rollback patch for your recent changes due to some balancing considerations. Could you please review and verify that? Thanks.

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

PR Comment: https://git.openjdk.org/jdk/pull/23686#issuecomment-2684145693


More information about the core-libs-dev mailing list