Issue Type: Bug Bug
Affects Versions: JRuby 1.6.7
Assignee: Unassigned
Components: Core Classes/Modules
Created: 23/Aug/12 12:22 PM
Description:

I get java.lang.ArrayIndexOutOfBoundsException: 100000 while trying to profile my rails app.

With JRUBY_OPTS set to '--1.9 -Xlaunch.inproc=false --profile.api', running rails s -p 3001 gives:

Profiling enabled; ^C shutdown will now dump profile info
Profiling enabled; ^C shutdown will now dump profile info
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
spawn> default options = {:method=>:thread}
Exiting
LoadError: load error: sass/plugin -- java.lang.ArrayIndexOutOfBoundsException: 100000
           require at org/jruby/RubyKernel.java:1042
           require at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251
   load_dependency at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236
           require at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251
            (root) at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/haml-3.1.6/lib/sass/rails3_shim.rb:15
     instance_eval at org/jruby/RubyBasicObject.java:1730
      execute_hook at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:36
    run_load_hooks at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:43
              each at org/jruby/RubyArray.java:1615
    run_load_hooks at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/lazy_load_hooks.rb:42
         Bootstrap at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/application/bootstrap.rb:69
     instance_exec at org/jruby/RubyBasicObject.java:1757
               run at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/initializable.rb:30
  run_initializers at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/initializable.rb:55
              each at org/jruby/RubyArray.java:1615
  run_initializers at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/initializable.rb:54
       initialize! at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/application.rb:136
          __send__ at org/jruby/RubyBasicObject.java:1698
              send at org/jruby/RubyKernel.java:2097
    method_missing at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30
            (root) at /Users/tim/git/1/jux/config/environment.rb:8
           require at org/jruby/RubyKernel.java:1042
           require at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251
   load_dependency at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236
           require at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251
        parse_file at /Users/tim/git/1/jux/config/environment.rb:4
     instance_eval at org/jruby/RubyBasicObject.java:1730
        initialize at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/rack-1.4.1/lib/rack/builder.rb:51
        parse_file at /Users/tim/git/1/jux/config.ru:1
              eval at org/jruby/RubyKernel.java:1088
        parse_file at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/rack-1.4.1/lib/rack/builder.rb:40
               app at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/rack-1.4.1/lib/rack/server.rb:200
               app at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/commands/server.rb:46
       wrapped_app at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/rack-1.4.1/lib/rack/server.rb:301
             start at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/rack-1.4.1/lib/rack/server.rb:252
             start at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/commands/server.rb:70
            (root) at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/commands.rb:55
               tap at org/jruby/RubyKernel.java:1787
            (root) at /Users/tim/.rvm/gems/jruby-1.6.7.2/gems/railties-3.2.8/lib/rails/commands.rb:50
           require at org/jruby/RubyKernel.java:1042
            (root) at script/rails:6

This does not happen if I remove the --profile.api option.

Searching jruby 1.6.7.2 source code for instances of 100000 gives:

$ grep -R 100000 src | grep -v 1000000 
src/org/jruby/compiler/ASTInspector.java:    public static final int RETRY = 0x100000; // contains a retry
src/org/jruby/demo/TextAreaReadline.java:    private static final int MAX_DOC_SIZE = 100000;
src/org/jruby/Ruby.java:    private static final int MAX_PROFILE_METHODS = 100000;

which leads me to believe that MAX_PROFILE_METHODS is too low.

Environment: Mac OS X 10.7.4
Java 1.7.0_05
jruby 1.6.7.2
Project: JRuby
Priority: Major Major
Reporter: Tim Olsen
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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