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

jspawnhelper without args fails with segfault

XMLWordPrintable

    • 21
    • b14
    • linux, os_x
    • Verified

        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.

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

                Created:
                Updated:
                Resolved: