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

os::write incorrectly handles partial write

    XMLWordPrintable

Details

    • 21
    • b16
    • Not verified

    Backports

      Description

        JDK-8303942 introduced a bug in os::write() in os.cpp for handling partial write:
        ```
        buf = (void *)((char *)buf + nBytes);
        ```
        should be

        ```
        buf = (void *)((char *)buf + res);
        ```

        We observed that in JDK 21, heap dump corruption observed in JDK-8303937 happens again when writing to a socket or pipe.

        Attachments

          Issue Links

            Activity

              People

                manc Man Cao
                manc Man Cao
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: