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

sun.nio.ch.Net.localAddress() crashes on null FD

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11.0.27-oracle
    • 8, 11
    • core-libs
    • None
    • b01

        In sun.nio.ch.Net, when localAddress() is called with a null value, the VM crashes.
        ---
        $ java -version
        openjdk version "1.8.0_412"
        OpenJDK Runtime Environment (Temurin)(build 1.8.0_412-b08)
        OpenJDK 64-Bit Server VM (Temurin)(build 25.412-b08, mixed mode)


        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # SIGSEGV (0xb) at pc=0x00007f700906a1fe, pid=3103, tid=0x00007f701f980700
        #
        # JRE version: OpenJDK Runtime Environment (8.0_412-b08) (build 1.8.0_412-b08)
        # Java VM: OpenJDK 64-Bit Server VM (25.412-b08 mixed mode linux-amd64 compressed oops)
        # Problematic frame:
        # v ~BufferBlob::jni_fast_GetIntField
        #
        # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
        #
        # An error report file with more information is saved as:
        # /home/crane/Desktop/jvm_crash/report/hs_err_pid3103.log
        #
        # If you would like to submit a bug report, please visit:
        # https://github.com/adoptium/adoptium-support/issues
        # The crash happened outside the Java Virtual Machine in native code.
        # See problematic frame for where to report the bug.
        #

        Aborted (core dumped)
        ----
        PoC.java

        import sun.nio.ch.Net;
        import java.io.FileDescriptor;
        import java.io.IOException;

        public class PoC {
            public static void main(String[] args) throws IOException {
                FileDescriptor fd = null;
                Net.localAddress(fd);
            }
        }

              wxiao Weibing Xiao
              ahgross Andrew Gross
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: