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

Assertion fails in os_linux.cpp after JDK-8333522

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 23.0.2
    • hotspot

      JDK-8333522 introduces the assertion which fails in case "Hierarchical Memory and Swap Limit is: Unlimited" in a container. Reproduced with 23.0.2

      In release build, "os::free_swap_space()" seems return a wrong value, but it seems doesn't affect any tests.

      Failed tests:

      runtime/CommandLine/PrintClasses.java#id1
      jdk/jfr/startupargs/TestDumpOnExit.java
      jdk/jfr/jcmd/TestJcmdStartStopDefault.java

      Root cause:

      In case of "Hierarchical Memory and Swap Limit is: Unlimited" in a container, OSContainer::memory_and_swap_limit_in_bytes(), and then os::total_swap_space(), returns a negative value which causes the assertion failure.

      I added "-Xlog:os+container=trace" when running runtime/CommandLine/PrintClasses.java:

      ```
      [1.297s][trace][os,container] Path to /memory.memsw.limit_in_bytes is /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes
      [1.297s][trace][os,container] Memory Usage is: 2220986368
      [1.297s][trace][os,container] Memory and Swap Limit is: 9223372036854771712
      [1.297s][trace][os,container] Non-Hierarchical Memory and Swap Limit is: Unlimited
      [1.297s][trace][os,container] Path to /memory.stat is /sys/fs/cgroup/memory/memory.stat
      [1.297s][trace][os,container] Path to /memory.usage_in_bytes is /sys/fs/cgroup/memory/memory.usage_in_bytes
      [1.297s][trace][os,container] Memory Usage is: 2220978176
      [1.297s][trace][os,container] Hierarchical Memory and Swap Limit is: 9223372036854771712
      [1.297s][trace][os,container] Hierarchical Memory and Swap Limit is: Unlimited
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/builds/jdk/src/hotspot/os/linux/os_linux.cpp:326), pid=987, tid=988
      # assert(host_free_swap_val >= 0) failed: sysinfo failed?
      ```

            Unassigned Unassigned
            rmarchenko Roman Marchenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: