Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6RC3
-
Fix Version/s: JRuby 1.7.0.RC1
-
Component/s: None
-
Labels:None
-
Environment:Hidejruby 1.6.0.RC3 (ruby 1.8.7 patchlevel 330) (2011-03-13 a8e5382) (Java HotSpot(TM) Client VM 1.6.0_22) [darwin-i386-java]
Mac OS; JRuby built and run from "rvm" <http://rvm.beginrescueend.com/>
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
Rails 2.3Showjruby 1.6.0.RC3 (ruby 1.8.7 patchlevel 330) (2011-03-13 a8e5382) (Java HotSpot(TM) Client VM 1.6.0_22) [darwin-i386-java] Mac OS; JRuby built and run from "rvm" < http://rvm.beginrescueend.com/ > java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode) Rails 2.3
-
Number of attachments :
Description
When I running the specs for a (large) Rails app with the profiler and sample enabled I'm getting a Java stack trace thrown at exit. The spec runs normally, although it does take a very long time to start; much longer than JRuby 1.4 or 1.5.
$ JRUBY_OPTS='--profile.flat --sample' spec spec/an_ordinary_spec.rb
.................................
Finished in 0.661 seconds
33 examples, 0 failures
main thread profile results:
Total time: 66.40
total self children calls method
----------------------------------------------------------------
65.55 0.02 65.53 11726 Kernel#require
65.54 0.00 65.54 59 Kernel#load
[snip]
8.38 0.00 8.38 1 Bundler.require
8.38 0.00 8.38 1 Bundler::Runtime#require
6.59 0.00 6.59 1 Rails::Initializer#load_application_initializers
AbstractProfilePrinter.java:96:in `getMethodName': java.lang.ArrayIndexOutOfBoundsException: 105076
from AbstractProfilePrinter.java:86:in `methodName'
from FlatProfilePrinter.java:78:in `printProfile'
from Ruby.java:2770:in `tearDown'
from Ruby.java:2693:in `tearDown'
from Main.java:201:in `internalRun'
from Main.java:164:in `run'
from Main.java:148:in `run'
from Main.java:128:in `main'
I guess that it must be confused by an anonymous Ruby class, or one that has been garbage-collected. I can reproduce this locally, but it does seem to be triggered by this application's code (or its sheer size). I haven't been able to reproduce it outside of the app environment.
Very interesting! I wonder what method didn't get registered properly.
I will likely patch this for 1.6 to ignore methods it can't find, but ideally we'd figure out which one it is. Perhaps once I have it patched you can try to run a graph profile and ascertain which method is missing?