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

alias_method intermittent issue in 1.7.6 & 1.7.8 (example to recreate included) #1260

jayjlawrence opened this issue Nov 24, 2013 · 3 comments


Copy link

This one is to pinpoint but I have observed it with the following combination:
a) jruby 1.7.8
b) bundler 1.5.0.rc.1
c) warbler 1.40
d) git refs in my Gemfile

What appears to occur is when bundler monkey patches Gem::Specification the 'alias_method' does results in the newly aliased method pointing to the newly created replacement. i.e. in bundler/lib/bundler/rubygems_ext.rb:

  1. Gem::Specification.loaded_from -> aliased to -> rg_loaded_from
  2. New Gem::Specification.loaded_from defined immediately after
  3. Calling rg_loaded_from actually executes loaded_ from
  4. = stack level too deep

I've made a project that reproduces this issue. Interestingly this example fails in 1.7.6 as well but my real project succeeds in 1.7.6. I have not tried earlier versions.

You may check out and perform the following:
a) rvm use 1.7.8
b) bundle install
c) bundle exec warble war
d) observe error

I've confirmed on Linux java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

and OS X java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Copy link

headius commented Nov 24, 2013

Wow that is super funky. Usually that comes in when you have two threads both try to alias at the same time but we should not allow that to happen. High priority.

Copy link

Thanks Charles - let me know when you have a proposed fix and then I will pull & test.

@kares kares added this to the JRuby 1.7.27 milestone Jan 17, 2017
Copy link

enebo commented Feb 17, 2017

I am resolving this. The warbler issue implies this is no longer an issue and 1.7.x is approaching EOL. I changed from a specific version of warbler to the latest (also changing jruby-jars to 1.7.26) and I was able to generate the war file. From the original description it is also unclear whether this was a warbler or jruby issue to me so I will go with it was a warbler issue that was resolved.

@enebo enebo closed this as completed Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants