Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.2
-
Fix Version/s: JRuby 1.2
-
Component/s: None
-
Labels:None
-
Environment:osx 10.5.6 - java version "1.5.0_16" - (powerbook 12 - 1.33GHz)
Description
An amazing bug occurs with jruby-1.2rc1 (and not with jruby-1.1.6).
Let the first line of a script be the standard shebang;
#!/bin/env jruby
If this first line contains one *and only one* white space at the end,
then a java error occurs immediately:
Shared archive: sharing disabled for server vm
String.java:558:in `charAt': java.lang.StringIndexOutOfBoundsException: String index out of range: 0
from RubyInstanceConfig.java:745:in `isInterpreterArgument'
from RubyInstanceConfig.java:707:in `processArguments'
from RubyInstanceConfig.java:516:in `processArguments'
from Main.java:197:in `run'
from Main.java:110:in `run'
from Main.java:94:in `main'
This error arises either if the script is called as an unix command
thanks to the shebang, or directly as an argument to the jruby
command.
Issue Links
- relates to
-
JRUBY-1967
jruby bash scripts do not work on bash-less unix'es
-
Cute. I think this is a combination of bad (missing) length-checking in RubyInstanceConfig and our bash scripts producing zero-length arguments passed to org.jruby.Main. I'll fix both.