-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.7.21: getScriptSource -> isSymLink raises NullPointerException when script source is stdin #3901
Comments
So the problem here is that The fix seems to be pretty simple: use the pure-Java POSIX. The behavior of lstat won't be as correct, but it should still generally work well enough for isSymLink. Might be a weird one to write a test for, though :-) |
That commit didn't do it for me, unfortunately. Tested on Linux:
|
Ok, figured out the additional error: on OS X, /dev/stdin is a symlink for /dev/fd/0, so I pass the isSymLink test in RubyInstanceConfig. If I instead use /dev/fd/0 I can reproduce your error. BIt more work needed! |
Additional fix for issue exposed by jruby#3901. Devices, like ttys, pipes, fifos and the like may be neither file nor symlink, but still readable as script source. The restriction here is unnecessary.
Hi,
Ever since JRuby 1.7.21, when you specify stdin explicitly as the filepath for the script source, which we do in order to execute a heredoc that takes command line arguments, it results in a NullPointerException in getScriptSource -> isSymLink as detailed below.
Background
We're stuck on JRuby 1.7 for the time being on OpenVMS, as there is only Java 6 for this platform. The issue I'm reporting, however, is not VMS-only, but is also reproducible on Linux.
Environment
The issue is reproducible in all of these JRuby versions:
The issue is not reproducible in these versions:
uname -a
)Expected Behavior
In JRuby 1.7.20 on both OSes, this was the previous behaviour when specifying stdin as the script source so that arguments can also be passed to a heredoc script. I have reproduced this in a simple one-liner to illustrate the issue more concisely:
On VMS, the shell syntax is different, but this is the equivalent construct and it gives the same result under 1.7.20:
Actual Behavior
In JRuby 1.7.25 on Linux, this is the result:
The same error occurs in 1.7.25 on OpenVMS ia64, and 1.7.21 on Linux, when the regression seems to have been introduced.
Impact & Workaround
The impact on us is minimal. We only have one occurrence of the failing construct, and we can easily work around it by passing the arguments to the heredoc ruby script from DCL (OpenVMS default shell) by setting environment variables, read by the heredoc script through ENV.
Thanks,
Ben
The text was updated successfully, but these errors were encountered: