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

Enabling of native memory tracking using NMT_LEVEL causes to JVM crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • None
    • 8
    • hotspot

    Description

      When trying to enable Java NMT through the `JAVA_TOOL_OPTIONS` env variable, the JVM crashes.

      Steps to reproduce:

      export JAVA_TOOL_OPTIONS="-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics"

      export NMT_LEVEL_<java process pid>=summary`

      And then java will crash:

      root@7156fa1d0779:/# export NMT_LEVEL_3326=summary
      root@7156fa1d0779:/# ./jdk8u302-b08/bin/java -version
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007fdd2312ab77, pid=3326, tid=0x00007fdd2247d700
      #
      # JRE version: (8.0_302-b08) (build )
      # Java VM: OpenJDK 64-Bit Server VM (25.302-b08 mixed mode linux-amd64 compressed oops)
      # Problematic frame:
      # V [libjvm.so+0xb29b77] VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x77
      #
      # Core dump written. Default location: //core or core.3326
      #
      # An error report file with more information is saved as:
      # //hs_err_pid3326.log
      #
      # If you would like to submit a bug report, please visit:
      # https://github.com/adoptium/adoptium-support/issues
      #
      Aborted (core dumped)

      Can be easily reproduced in container env, to get java PID - ps gives us current PID, the expected PID will be the next number.

      Reproducible on Linux and MacOS.

      Attachments

        Issue Links

          Activity

            People

              mchernov Michail Chernov
              mchernov Michail Chernov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: