java.lang.ArrayIndexOutOfBoundsException in Dir#glob
----------------------------------------------------

                 Key: JRUBY-4664
                 URL: http://jira.codehaus.org/browse/JRUBY-4664
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.4, JRuby 1.5
         Environment: jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-03-19 
646afea) (Java HotSpot(TM) Client VM 1.6.0_15) [i386-java]

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.3)
activerecord-jdbcpostgresql-adapter (0.9.3)
activeresource (2.3.5)
activesupport (2.3.5)
columnize (0.3.1)
glassfish (1.0.2)
jdbc-postgres (8.3.604)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.1)
sources (0.0.1)


jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 
Client VM 1.6.0_15) [i386-java]

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.2)
activerecord-jdbcpostgresql-adapter (0.9.2)
activeresource (2.3.5)
activesupport (2.3.5)
glassfish (1.0.2)
jdbc-postgres (8.3.604)
jruby-openssl (0.6)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.2.9)
sources (0.0.1)

            Reporter: Uwe Kubosch


I have a Rails application that scans log files.  I use 
Dir['/raid/gfs-logs/admin-logs/log/poller.log'] to find files to scan.  When 
the glob matches exactly one file, I get the following error:

JRuby trunk:

Exception in thread "Thread-9" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.jruby.util.ByteList.<init>(ByteList.java:114)
        at org.jruby.util.ByteList.<init>(ByteList.java:107)
        at org.jruby.util.Dir$1.call(Dir.java:403)
        at org.jruby.util.Dir$2.call(Dir.java:411)
        at org.jruby.util.Dir.glob_helper(Dir.java:568)
        at org.jruby.util.Dir.push_globs(Dir.java:450)
        at org.jruby.util.Dir.push_braces(Dir.java:424)
        at org.jruby.util.Dir.push_glob(Dir.java:303)
        at org.jruby.RubyDir.aref(RubyDir.java:162)
        at 
org.jruby.RubyDir$s_method_0_0$RUBYINVOKER$aref.call(org/jruby/RubyDir$s_method_0_0$RUBYINVOKER$aref.gen:65535)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:630)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:186)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at 
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:156)
        at 
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
        at org.jruby.ast.VCallNode.interpret(VCallNode.java:85)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at 
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:327)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:78)
        at org.jruby.runtime.Block.call(Block.java:89)
        at org.jruby.RubyProc.call(RubyProc.java:224)
        at org.jruby.RubyProc.call(RubyProc.java:207)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:94)
        at java.lang.Thread.run(Thread.java:619)


JRuby 1.4.0:

Exception in thread "Thread-8" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.jruby.util.ByteList.<init>(ByteList.java:109)
        at org.jruby.util.ByteList.<init>(ByteList.java:102)
        at org.jruby.util.Dir$1.call(Dir.java:403)
        at org.jruby.util.Dir$2.call(Dir.java:411)
        at org.jruby.util.Dir.glob_helper(Dir.java:568)
        at org.jruby.util.Dir.push_globs(Dir.java:450)
        at org.jruby.util.Dir.push_braces(Dir.java:424)
        at org.jruby.util.Dir.push_glob(Dir.java:303)
        at org.jruby.RubyDir.aref(RubyDir.java:158)
        at 
org.jruby.RubyDir$s_method_0_0$RUBYINVOKER$aref.call(org/jruby/RubyDir$s_method_0_0$RUBYINVOKER$aref.gen)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:623)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:176)
        at 
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:310)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at 
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:136)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:153)
        at 
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:290)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:109)
        at org.jruby.ast.VCallNode.interpret(VCallNode.java:85)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at 
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:317)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:305)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:72)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:78)
        at org.jruby.runtime.Block.call(Block.java:89)
        at org.jruby.RubyProc.call(RubyProc.java:221)
        at org.jruby.RubyProc.call(RubyProc.java:204)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:94)
        at java.lang.Thread.run(Thread.java:619)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to