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

jspawnhelper without args fails with segfault

    XMLWordPrintable

Details

    • b14
    • linux, os_x

    Backports

      Description

        When `jspawnhelper` is run without args it outputs:

        "This command is not for general use and should only be run as the result of a call to ProcessBuilder.start() or Runtime.exec() in a java application"

        JDK-8310265 broke this. Now `jspawnhelper` fails with sigfault because of the change:

        - /* argv[0] contains the fd number to read all the child info */
        + /* argv[1] contains the fd number to read all the child info */
            int r, fdin, fdout;

        - r = sscanf (argv[argc-1], "%d:%d", &fdin, &fdout);
        + r = sscanf (argv[1], "%d:%d", &fdin, &fdout);

        Without args, argc is 1, so argv[1] is an out of bound access.

        Attachments

          Issue Links

            Activity

              People

                easlan Elif Aslan
                eastigeevich Evgeny Astigeevich
                Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: