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

JfrRecorderService failes with guarantee(num_written > 0) when no space left on device.

    XMLWordPrintable

Details

    • jfr
    • b12
    • generic
    • generic

    Backports

      Description

        Description:
        JfrRecorderService failes to write records and becomes Internal Error when no space left on device.

        Environment:
        Red Hat Enterprise Linux Server release 7.9 (Maipo)
        Intel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz
        4GB Memory

        openjdk version "18-ea" 2022-03-22
        OpenJDK Runtime Environment (build 18-ea+31-2049)
        OpenJDK 64-Bit Server VM (build 18-ea+31-2049, mixed mode, sharing)

        Actual output:
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (jfrStreamWriterHost.inline.hpp:80), pid=16941, tid=16961
        # guarantee(num_written > 0) failed: Nothing got written, or os::write() failed
        #
        # JRE version: OpenJDK Runtime Environment (18.0+31) (build 18-ea+31-2049)
        # Java VM: OpenJDK 64-Bit Server VM (18-ea+31-2049, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x874a8a] void JfrLinkedList<JfrBuffer, JfrCHeapObj>::iterate<PredicatedConcurrentWriteOp<UnBufferedWriteToChunk<JfrBuffer>, Excluded<JfrBuffer, true> > >(PredicatedConcurrentWriteOp<UnBufferedWriteToChunk<JfrBuffer>, Excluded<JfrBuffer, true> >&)+0x19a
        #
        # Core dump will be written. Default location: /work/core.16941
        #

        Expected output:
        JFR should report an appropriate message.

        How to reproduce :

        1. Run out of the disk

        $ dd if=/dev/zero of=largefile_200G.dat bs=1G count=200

        $ df -k
        Filesystem 1K-blocks Used Available Use% Mounted on
        /dev/mapper/rhel-root 47285700 47013032 268 100% /

        2. Execute an application and start JFR with -XX:FlightRecorderOptions=maxchunksize=1M

        ---------- BEGIN SOURCE ----------
                Configuration profConfig = Configuration.getConfiguration("profile");
                Recording recording = new Recording(profConfig);
                recording.setName("TestJFR");
                recording.start();
                while (true) {
                    try {
                       new Object();
                       Thread.sleep(1);
                    } catch (Exception ex) {
                    }
                }
                recording.stop();
        ---------- END SOURCE ---------

        3. Watch jfr files and the disk size.

        $ cd /tmp/2022_01_13_20_56_16_32501
        $ watch -n 3 "ls -l ; df -k"
        $ ls -l ; df -k
        total 1256
        -rw-rw-r--. 1 isadmin isadmin 1091928 Jan 13 21:05 2022_01_13_20_56_16.jfr
        -rw-rw-r--. 1 isadmin isadmin 192512 Jan 13 21:05 2022_01_13_21_05_17.jfr

        tmpfs 1940260 0 1940260 0% /sys/fs/cgroup
        /dev/mapper/rhel-root 47285700 47285680 20 100% /

        Attachments

          Issue Links

            Activity

              People

                mgronlun Markus Grönlund
                tkiriyama Takuya Kiriyama
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: