JDK-8372745 : [lworld] Fatal error in native method when running java/foreign/sharedclosejvmti/TestSharedCloseJvmti.java with --enable-preview
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.foreign
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2025-11-28
  • Updated: 2025-11-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaUnresolved
Description
[2025-11-28T14:07:11.138679Z] Waiting for completion for process 82548
[fork] FATAL ERROR in native method: Wrong object class or methodID passed to JNI call
[fork]  at jdk.internal.foreign.MemorySessionImpl.checkValidStateRaw(java.base@26-jep401ea2/MemorySessionImpl.java:206)
[fork]  at jdk.internal.foreign.MemorySessionImpl.checkValidState(java.base@26-jep401ea2/MemorySessionImpl.java:215)
[fork]  at jdk.internal.foreign.SegmentFactories.allocateNativeInternal(java.base@26-jep401ea2/SegmentFactories.java:189)
[fork]  at jdk.internal.foreign.SegmentFactories.allocateNativeSegment(java.base@26-jep401ea2/SegmentFactories.java:181)
[fork]  at jdk.internal.foreign.ArenaImpl.allocate(java.base@26-jep401ea2/ArenaImpl.java:56)
[fork]  at jdk.internal.foreign.ArenaImpl.allocate(java.base@26-jep401ea2/ArenaImpl.java:31)
[fork]  at java.lang.foreign.SegmentAllocator.allocate(java.base@26-jep401ea2/SegmentAllocator.java:644)
[fork]  at TestSharedCloseJvmti$EventDuringScopedAccessRunner.<clinit>(TestSharedCloseJvmti.java:75)
Comments
We're on b23 so it's not in yet, but looks like this is a duplicate of that. Let's see once the fix is merged. Thanks [~jvernee]!
28-11-2025

You might want to make sure that the lworld repo contains the fix for https://bugs.openjdk.org/browse/JDK-8371474
28-11-2025