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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 15
    • Fix Version/s: None
    • Component/s: core-svc
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: