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

Crash in rebuild_cpu_to_node_map

    Details

    • Subcomponent:
    • Introduced In Build:
      b107
    • Introduced In Version:
      9
    • Resolved In Build:
      b137
    • CPU:
      x86_64
    • OS:
      linux

      Backports

        Description

        Running the following command line causes a crash in os::Linux::rebuild_cpu_to_node_map:
         numactl -m 0 -c 0 /localhome/java/jdk9-107/bin/java -XX:+UseNUMA -version

        The crash is reproducible starting from JDK 9 build 107.

        Relevant pieces of the code:
          size_t cpu_num = os::active_processor_count();
          ...
          cpu_to_node()->at_grow(cpu_num - 1);
          ...
                  for (size_t k = 0; k < BitsPerCLong; k++) {
                    if (cpu_map[j] & (1UL << k)) {
                      cpu_to_node()->at_put(j * BitsPerCLong + k, i);
                    }
                  }

        On my 32 hw thread machine (2 socket x 8 core x 2 ht) cpu_num becomes 16 when numactl -c 0 is used, and we write outside of the array when K becomes 16.

        os::active_processor_count() was changed in build 107 with the changeset for:
         JDK-6515172: Runtime.availableProcessors() ignores Linux taskset command
         http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/c5480d4abfe4

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dholmes David Holmes
                  Reporter:
                  stefank Stefan Karlsson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: