Skip to content

Subprocess launch with shell fails with empty env #8289

@headius

Description

@headius

It seems we are missing some shell-launching fallback case when ENV has been cleared.

r, w = IO.pipe
ENV.delete("PATH")
success = system("echo", "hello", out: w)
w.close
p success
p r.read

On CRuby, this runs successfully, returning true for success and the expected output is read.

On JRuby, the system call fails, returning nil. Removing the ENV modification fixes it. @mullermp confirmed for his example that deleting PATH from ENV is enough to break it, so I suspect we are failing to find the shell with PATH and not falling back on /bin/sh or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions