Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JRuby bundler regression in 9.0.5.0 #3635

Closed
ginkel opened this issue Feb 2, 2016 · 4 comments
Closed

JRuby bundler regression in 9.0.5.0 #3635

ginkel opened this issue Feb 2, 2016 · 4 comments

Comments

@ginkel
Copy link

ginkel commented Feb 2, 2016

Since upgrading from JRuby 9.0.4.0 to 9.0.5.0 we have a very high probability of our builds failing during bundling. Bundler aborts with a Java::JavaLang::ArrayIndexOutOfBoundsException, which it did not on 9.0.4.0. Unfortunately, I can't seem to generate a backtrace for the ArrayIndexOutOfBoundsException, which manifests like this:

Gem::InstallError: invalid gem: package is corrupt, exception while verifying: 32 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /usr/local/bundle/cache/temple-0.7.6.gem

Additionally, the following warning is emitted during bundling, which hasn't been the case for 9.0.4.0:

WARNING: SSLSocket#session= is not supported

Not sure whether that's related to the issues...

I have created a Gist that contains everything that's needed to reproduce the issue through a Docker image build (you can also run the respective code manually, of course, but make sure that you have no Gems cached / installed before each run to increase the chances of failure):

https://gist.github.com/ginkel/9e27221d911c663e4107

Trigger the bug using: while docker build --no-cache -t bundler-jruby-9.0.5.0-regression .; do :; done

$ jruby --version
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 25.66-b17 on 1.8.0_66-internal-b17 +jit [linux-amd64]
@headius
Copy link
Member

headius commented Mar 4, 2016

@ginkel Thanks for the report...we'll try to look at this for JRuby 9.1.

@kares
Copy link
Member

kares commented Apr 20, 2016

must be a thread-safety issues of some kind - guessing maybe outside JRuby (in Bundler or RGs)

... its not consistent to reproduce and fails with a different index-out-of-bounds, here's some -d -w :

Exception `Gem::Package::FormatError' at /opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/rubygems/package.rb:571 - package is corrupt, exception while verifying: 113 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/multi_xml-0.5.5.gem
Exception `Gem::InstallError' at /opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/rubygems/installer.rb:216 - invalid gem: package is corrupt, exception while verifying: 113 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/multi_xml-0.5.5.gem
Exception `Gem::InstallError' at /opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/rubygems/installer.rb:216 - invalid gem: package is corrupt, exception while verifying: 113 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/multi_xml-0.5.5.gem

Gem::InstallError: invalid gem: package is corrupt, exception while verifying: 113 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/multi_xml-0.5.5.gem
Exception `Bundler::InstallError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/installer/gem_installer.rb:47 - An error occurred while installing multi_xml (0.5.5), and Bundler cannot continue.
Make sure that `gem install multi_xml -v '0.5.5'` succeeds before bundling.
Exception `Bundler::InstallError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/installer/gem_installer.rb:47 - An error occurred while installing multi_xml (0.5.5), and Bundler cannot continue.
Make sure that `gem install multi_xml -v '0.5.5'` succeeds before bundling.
Exception `Gem::Package::FormatError' at /opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/rubygems/package.rb:571 - package is corrupt, exception while verifying: 79 (Java::JavaLang::ArrayIndexOutOfBoundsException) in /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/activerecord-nulldb-adapter-0.3.2.gem
Exception `Bundler::GemspecError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:225 - Could not read gem at /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/activerecord-nulldb-adapter-0.3.2.gem. It may be corrupted.

Bundler::GemspecError: Could not read gem at /opt/local/rvm/gems/jruby-9.0.5.0@temp/cache/activerecord-nulldb-adapter-0.3.2.gem. It may be corrupted.
Exception `Bundler::InstallError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/installer/gem_installer.rb:47 - An error occurred while installing activerecord-nulldb-adapter (0.3.2), and Bundler cannot continue.
Make sure that `gem install activerecord-nulldb-adapter -v '0.3.2'` succeeds before bundling.
Installing postgres_ext 2.4.1

Exception `Bundler::InstallError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/installer/gem_installer.rb:47 - An error occurred while installing activerecord-nulldb-adapter (0.3.2), and Bundler cannot continue.
Make sure that `gem install activerecord-nulldb-adapter -v '0.3.2'` succeeds before bundling.
Java::JavaLang::ArrayIndexOutOfBoundsException: 81
Exception `Bundler::InstallError' at /opt/local/rvm/gems/jruby-9.0.5.0@temp/gems/bundler-1.11.2/lib/bundler/installer/gem_installer.rb:47 - An error occurred while installing postgres_ext (2.4.1), and Bundler cannot continue.
Make sure that `gem install postgres_ext -v '2.4.1'` succeeds before bundling.

@kares
Copy link
Member

kares commented Apr 20, 2016

was wrong, its coming from regexp -> joni -> jcodings :

java.lang.ArrayIndexOutOfBoundsException: 22
    at org.jcodings.specific.BaseUTF8Encoding.mbcCaseFold(BaseUTF8Encoding.java:167)
    at org.jcodings.specific.UTF8Encoding.mbcCaseFold(UTF8Encoding.java:24)
    at org.joni.SearchAlgorithm$SLOW_IC.lowerCaseMatch(SearchAlgorithm.java:238)
    at org.joni.SearchAlgorithm$SLOW_IC.search(SearchAlgorithm.java:206)
    at org.joni.Matcher.forwardSearchRange(Matcher.java:140)
    at org.joni.Matcher.searchInterruptible(Matcher.java:451)
    at org.jruby.RubyRegexp$SearchMatchTask.run(RubyRegexp.java:271)
    at org.jruby.RubyThread.executeBlockingTask(RubyThread.java:1337)
    at org.jruby.RubyRegexp.matcherSearch(RubyRegexp.java:233)
    at org.jruby.RubyRegexp.search19(RubyRegexp.java:1129)
    at org.jruby.RubyRegexp.search19(RubyRegexp.java:1075)
    at org.jruby.RubyRegexp.eqq19(RubyRegexp.java:985)
    at org.jruby.RubyRegexp$INVOKER$i$1$0$eqq19.call(RubyRegexp$INVOKER$i$1$0$eqq19.gen)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
    at org.jruby.ir.runtime.IRRuntimeHelpers.isEQQ(IRRuntimeHelpers.java:466)
    at opt.local.rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.lib.ruby.stdlib.psych.scalar_scanner.RUBY$method$tokenize$0(/opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych/scalar_scanner.rb:37)
    at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
    at opt.local.rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.lib.ruby.stdlib.psych.visitors.to_ruby.invokeOther321:tokenize(/opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych/visitors/to_ruby.rb)
    at opt.local.rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.lib.ruby.stdlib.psych.visitors.to_ruby.RUBY$method$deserialize$0(/opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych/visitors/to_ruby.rb:63)
    at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:131)
    at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:194)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
    at opt.local.rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.lib.ruby.stdlib.psych.visitors.to_ruby.invokeOther2:deserialize(/opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych/visitors/to_ruby.rb)
    at opt.local.rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.lib.ruby.stdlib.psych.visitors.to_ruby.RUBY$method$visit_Psych_Nodes_Scalar$0(/opt/local/rvm/rubies/jruby-9.0.5.0/lib/ruby/stdlib/psych/visitors/to_ruby.rb:122)

@kares
Copy link
Member

kares commented Apr 20, 2016

thus this is a duplicate of #3670 (also reported as #3676) already expected to be fixed for 9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants