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

java/lang/management/ThreadMXBean/MaxDepthForThreadInfoTest.java throws NullpointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 15
    • core-svc

      Seen three times in tier7 CI.

      java.lang.NullPointerException
      at MaxDepthForThreadInfoTest.main(MaxDepthForThreadInfoTest.java:59)

      Seems like a test bug:

              long[] threadIds = tmxb.getAllThreadIds();

              ...

              tinfos = tmxb.getThreadInfo(threadIds, true, true, 3);
              for (ThreadInfo ti : tinfos) {
                  if (ti.getStackTrace().length > 3) { <= NPE here

      There is no guarantee that all threads found by getAllThreadIds() are still alive by the time we call getThreadInfo() so we have to allow for null array entries.

      This fails in tier7 with graal, so I expect there are threads present that are not normally seen.

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: