JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6666

Open3.popen3 failing due to missing handling for [path, argv[0]] array

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      JRuby 1.6.7, Mac OS X 10.7.3, Java 1.6.0_31 64-bit server VM
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      A BioRuby unit test is failing with JRuby 1.6.7 in 1.8 mode, when it
      tries to pass a two-element array (giving the path and argv[0] value)
      as the sole element of the argument list to Open3.popen3. This works
      under MRI and should be permissible according to the 1.8.7
      documentation.

      I created RubySpec specs for Open3.popen3 to demonstrate this, at
      https://github.com/rubyspec/rubyspec/pull/137. They pass under MRI and
      fail under JRuby 1.6.7.

      I have worked up a patch for
      org.jruby.util.ShellLauncher.parseCommandLine which fixes this. Since
      Java's ProcessBuilder doesn't give us a way to pass the command path
      and argv[0] separately to execve, I added a bit of code to detect this
      case and discard the argv[0] value. This makes the above RubySpec
      pass. All tests appear to pass with "ant test", "ant
      spec:ci_interpreted_18", and "ant spec:ci_interpreted_19", as well. I
      will submit this as a pull request momentarily.

        Activity

        Hide
        Clayton Wheeler added a comment -
        Show
        Clayton Wheeler added a comment - Pull request is at https://github.com/jruby/jruby/pull/173 .
        Hide
        Clayton Wheeler added a comment -

        Pull request against master at https://github.com/jruby/jruby/pull/181. Didn't realize it was the end of the line for 1.6 already.

        Show
        Clayton Wheeler added a comment - Pull request against master at https://github.com/jruby/jruby/pull/181 . Didn't realize it was the end of the line for 1.6 already.
        Hide
        Charles Oliver Nutter added a comment -

        Pulled! Thank you!

        Show
        Charles Oliver Nutter added a comment - Pulled! Thank you!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Clayton Wheeler
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: