jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3467

bug with *one* extra space on shebang with jruby-1.2rc1

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

Bug - A problem which impairs or prevents the functions of the product. JRUBY-1967 jruby bash scripts do not work on bash-less unix'es

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 05/Mar/09 12:22 PM

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.

Show
Charles Oliver Nutter added a comment - 05/Mar/09 12:22 PM 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.
Hide
Permalink
Charles Oliver Nutter added a comment - 05/Mar/09 1:18 PM

Resolved on trunk and 1_2 branch.

Show
Charles Oliver Nutter added a comment - 05/Mar/09 1:18 PM Resolved on trunk and 1_2 branch.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Maurice Diamantini
Vote (0)
Watch (0)

Dates

  • Created:
    05/Mar/09 3:28 AM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    05/Mar/09 1:18 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.