Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244961

MethodHandles::privateLookupIn throws NPE when called during initPhase2

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:

      Description

      When move nio to using panama instead of JNI, we encounter following error cause by usage of LongAdder in MemoryScope.

      Picked up _JAVA_OPTIONS: -Xlog:init=debug
      Error occurred during initialization of boot layer
      java.lang.ExceptionInInitializerError
      at java.base/jdk.internal.foreign.MemoryScope$Root.<init>(MemoryScope.java:136)
      at java.base/jdk.internal.foreign.MemoryScope.<clinit>(MemoryScope.java:43)
      at java.base/jdk.internal.foreign.AbstractMemorySegmentImpl.<clinit>(AbstractMemorySegmentImpl.java:440)
      at java.base/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:506)
      at java.base/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:460)
      at java.base/sun.nio.fs.UnixNativeDispatcher.getcwd(UnixNativeDispatcher.java:108)
      at java.base/sun.nio.fs.UnixFileSystem.<init>(UnixFileSystem.java:67)
      at java.base/sun.nio.fs.BsdFileSystem.<init>(BsdFileSystem.java:50)
      at java.base/sun.nio.fs.MacOSXFileSystem.<init>(MacOSXFileSystem.java:47)
      at java.base/sun.nio.fs.MacOSXFileSystemProvider.newFileSystem(MacOSXFileSystemProvider.java:44)
      at java.base/sun.nio.fs.MacOSXFileSystemProvider.newFileSystem(MacOSXFileSystemProvider.java:37)
      at java.base/sun.nio.fs.UnixFileSystemProvider.<init>(UnixFileSystemProvider.java:56)
      at java.base/sun.nio.fs.BsdFileSystemProvider.<init>(BsdFileSystemProvider.java:36)
      at java.base/sun.nio.fs.MacOSXFileSystemProvider.<init>(MacOSXFileSystemProvider.java:39)
      at java.base/sun.nio.fs.DefaultFileSystemProvider.<clinit>(DefaultFileSystemProvider.java:35)
      at java.base/java.nio.file.FileSystems.getDefault(FileSystems.java:185)
      at java.base/java.nio.file.Path.of(Path.java:147)
      at java.base/jdk.internal.module.SystemModuleFinders.ofSystem(SystemModuleFinders.java:188)
      at java.base/jdk.internal.module.ModuleBootstrap.boot(ModuleBootstrap.java:208)
      at java.base/java.lang.System.initPhase2(System.java:2055)
      Caused by: java.lang.NullPointerException
      at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:261)
      at java.base/java.util.concurrent.atomic.Striped64$1.run(Striped64.java:397)
      at java.base/java.util.concurrent.atomic.Striped64$1.run(Striped64.java:394)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
      at java.base/java.util.concurrent.atomic.Striped64.<clinit>(Striped64.java:393)
      ... 20 more

        Attachments

          Activity

            People

            • Assignee:
              mchung Mandy Chung
              Reporter:
              henryjen Henry Jen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: