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

Test7190310 fails with NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • 9
    • 9
    • hotspot

      ----------System.out:(4/131)----------
      wr.get() returned null
      java.lang.ref.WeakReference@1ca79ec
      The Object is being finalized
      queueReader returned, ref==wr is true
      ----------System.err:(23/1661)----------
      Exception in thread "main" java.lang.ExceptionInInitializerError
          at java.util.concurrent.ConcurrentHashMap.fullAddCount(ConcurrentHashMap.java:2581)
          at java.util.concurrent.ConcurrentHashMap.addCount(ConcurrentHashMap.java:2330)
          at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1080)
          at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1547)
          at java.lang.ClassLoader.getClassLoadingLock(ClassLoader.java:464)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:405)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:262)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
          at com.sun.javatest.regtest.agent.MainWrapper.main(MainWrapper.java:78)
      Caused by: java.lang.NullPointerException
          at java.util.concurrent.ThreadLocalRandom.getProbe(ThreadLocalRandom.java:982)
          at java.util.concurrent.ConcurrentHashMap.fullAddCount(ConcurrentHashMap.java:2581)
          at java.util.concurrent.ConcurrentHashMap.addCount(ConcurrentHashMap.java:2330)
          at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1080)
          at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1547)
          at java.lang.invoke.MethodType$ConcurrentWeakInternSet.add(MethodType.java:1282)
          at java.lang.invoke.MethodType.makeImpl(MethodType.java:314)
          at java.lang.invoke.MethodHandleNatives.findMethodHandleType(MethodHandleNatives.java:287)
          at java.util.concurrent.ThreadLocalRandom.initialSeed(ThreadLocalRandom.java:137)
          at java.util.concurrent.ThreadLocalRandom.<clinit>(ThreadLocalRandom.java:134)

      ThreadLocalRandom.java:

          /**
           * Returns the probe value for the current thread without forcing
           * initialization. Note that invoking ThreadLocalRandom.current()
           * can be used to force initialization on zero return.
           */
          static final int getProbe() {
      982: return U.getInt(Thread.currentThread(), PROBE);
          }

      U is a jdk.internal.misc.Unsaffe and getInt takes an Object and an offset.

      In order to get an NPE, Thread.currentThread() must be null.

      I tried reproducing it but can't.

      This is a compiler test which is why the subcomponent is compiler for now.

            Unassigned Unassigned
            jprovino Joseph Provino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: