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

IBM JRE crashes with jruby 9.1.2.0 when JRuby JIT is enabled #3964

Closed
atambo opened this issue Jun 13, 2016 · 47 comments
Closed

IBM JRE crashes with jruby 9.1.2.0 when JRuby JIT is enabled #3964

atambo opened this issue Jun 13, 2016 · 47 comments

Comments

@atambo
Copy link
Member

atambo commented Jun 13, 2016

So I upgraded from jruby 1.7.25 to jruby 9.1.2.0 and now the IBM JRE crashes whenever I try to run a rails application deployed to websphere using warbler.

I can prevent the crash by running with the JRuby JIT disabled like so: -Djruby.compile.mode=OFF. Here are the logs/java crash dumps:

websphere logs:
http://alextambellini.com/debug/console.log
http://alextambellini.com/debug/messages.log

/var/log/messages:
http://alextambellini.com/debug/system_messages.txt

java dump stuff:
http://alextambellini.com/debug/javacore.20160615.160251.9932.0002.txt
http://alextambellini.com/debug/core.20160615.160251.9932.0001.dmp
http://alextambellini.com/debug/core.20160615.160251.9932.0001.dmp.zip
http://alextambellini.com/debug/jitdump.20160615.160251.9932.0004.dmp
http://alextambellini.com/debug/Snap.20160615.160251.9932.0003.trc
https://gist.github.com/atambo/66e7f0093b7741737518e5ce8b306fdd

Environment

  • jruby 9.1.2.0
  • redhat 7.1
  • ibm jdk 8
  • websphere liberty profile

@mkristian, I know you've looked into similar things before (#1549). I'd be happy to let you look at whatever or get you stuff you need to help debug the issue.

@headius
Copy link
Member

headius commented Jun 13, 2016

Gotta be a version mismatch somewhere in your env, since 9.1.2.0 can boot OpenSSL just fine on its own (or we wouldn't even be able to install gems).

How did you do that upgrade? Is it possible two different versions of JRuby are getting spliced together?

@atambo
Copy link
Member Author

atambo commented Jun 13, 2016

I'm able to run rails fine locally, this error only happens when deploying the war file to websphere.

@headius
Copy link
Member

headius commented Jun 14, 2016

@atambo If you can turn on JRuby debug mode (-d or equivalent) on that server, we'd be able to see the full Java trace of that error. It would be helpful.

I must reiterate, though...assuming OpenSSL is loading properly for you locally, this error should not be possible unless there's another stale JRuby floating around somewhere (or a stale jruby-openssl).

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

Is it possible to turn on JRuby debug mode through a java property or environment variable? I package the rails application using https://github.com/jruby/warbler so I'm not sure how to pass the -d flag to jruby.

@mkristian
Copy link
Member

@atambo I see in your gist that you are loading the jopenssl.jar twice. is the app configured to run two jruby runtimes ? if yes, does it work when using only one runtime ?

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

Here is a more full backtrace:
https://gist.github.com/atambo/59ecef12c908817da8007583d280020f

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

@mkristian I have the move_jars_to_webinf_lib warbler config set to true so maybe that is why I have the jopenssl.jar twice? Once in the WEB-INF/lib directory and then once embedded inside of the jruby-stdlib.jar? Or did you see it somewhere else too?

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

@mkristian as for my app configuration I have it configured to use one runtime using these settings:

jruby.max.runtimes = 1
jruby.min.runtimes = 1

@mkristian
Copy link
Member

@atambo so the loadService log clearly shows a lot of files are loaded exactly twice. jars as well regular ruby files. it almost looks like all files are loaded twice. and it looks almost that a new ruby gets spawned,

the move_jars_to_webinf_lib is also not working properly as the jruby-openssl jars are found inside the gem. same for the thread_safe gem. if those jars are also part of WEB-INF/lib then this can lead to the error you see.

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

I do see it loading everything twice. I'm not sure what would be causing that as I am not setting multiple runtimes. Is it possible my rails application is doing some weird threading or something that could be causing this issue?

I tried turning move_jars_to_webinf_lib to false but then the JVM segfaults with the following javacore file:

https://gist.github.com/atambo/06e597b7765649e711b189b4e3893a4c

I'm not sure how to read that javacore to see the reason.

@mkristian
Copy link
Member

@atambo segfault :(
could manually locate those

WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/jopenssl.jar
WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar
WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/org/bouncycastle/bcpkix-jdk15on/1.54/bcpkix-jdk15on-1.54.jar

just to see if those MethodNotFoundErrors go away.

looking at your original gist of the loadService:

$ cat gistfile1.txt | grep java.rb | grep found
[err] 2016-06-13T17:57:35.377-04:00 [Default Executor-thread-5] INFO LoadService : found builtinLib: java.rb
[err] 2016-06-13T17:57:35.378-04:00 [Default Executor-thread-5] INFO LoadService : found builtinLib: java.rb
[err] 2016-06-13T17:57:36.175-04:00 [Default Executor-thread-5] INFO LoadService : found fileResource: uri:classloader:/jruby/java.rb
[err] 2016-06-13T17:58:02.158-04:00 [Default Executor-thread-5] INFO LoadService : found builtinLib: java.rb
[err] 2016-06-13T17:58:02.158-04:00 [Default Executor-thread-5] INFO LoadService : found builtinLib: java.rb
[err] 2016-06-13T17:58:02.188-04:00 [Default Executor-thread-5] INFO LoadService : found fileResource: uri:classloader:/jruby/java.rb

I expect java.rb to found and loaded only once. just saying something is odd here.

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

So when I manually put jopenssl.jar bcprov-jdk15on-1.54.jar and bcpkix-jdk15on-1.54.jar into the WEB-INF/lib directory and also have move_jars_to_webinf_lib set to false I no longer get the segfault. However I still get the same NoSuchMethodError:

Caused by: java.lang.NoSuchMethodError: org/jruby/gen/org$jruby$ext$openssl$OpenSSL$POPULATOR.populateMethod(Lorg/jruby/internal/runtime/methods/JavaMethod;ILjava/lang/String;ZLorg/jruby/internal/runtime/methods/CallConfiguration;ZLjava/lang/Class;Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;)V

So those jars being in the WEB-INF/lib are related to the segfault somehow.

@mkristian
Copy link
Member

you also need to remove those jars from from gem location and replace them with empty.jars. we just need to make sure that those jars are only ONCE on classloader hierarchy

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

So if I delete the jars from the jruby-openssl gem and the stdlib and just have them be in the WEB-INF/lib I get the following error:

RuntimeError:

        you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command

no such file to load -- org/bouncycastle/bcpkix-jdk15on/1.54/bcpkix-jdk15on-1.54 (LoadError)
              do_require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb:381
    block in require_jar at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb:288
  require_jar_with_block at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb:316
             require_jar at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb:287
             require_jar at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jar_dependencies.rb:390
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/jopenssl/load.rb:13
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/openssl.rb:1
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/openssl.rb:1
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:1
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:2
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:1
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:4
                 require at org/jruby/RubyKernel.java:944
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:1
                 require at org/jruby/RubyKernel.java:944
                  (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:11
                  (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1
                   <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1

I saw there is a environment variable jruby.openssl.load.jars I can set to false here:
https://github.com/jruby/jruby-openssl/blob/master/lib/jopenssl/load.rb#L7

Which gets me past the above error and gets me a new error:

NameError: missing class name (`org.jruby.ext.openssl.OpenSSL')
  method_missing at org/jruby/javasupport/JavaPackage.java:261
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/jopenssl/load.rb:26
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/openssl.rb:1
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/openssl.rb:1
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:1
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:2
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:1
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:4
         require at org/jruby/RubyKernel.java:944
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:1
         require at org/jruby/RubyKernel.java:944
          (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:11
          (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1
           <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1

It doesn't seem to be looking in WEB-INF/lib when loading jar files.

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

So it looks like the move_jars_to_webinf_lib makes an empty jar file in the place of the jopenssl.jar so that is why I get the missing class name (org.jruby.ext.openssl.OpenSSL')because it isn't actually loading anything in the WEB-INF/lib directory. I think what I really need to be able to do is to be able to turn offmove_jars_to_webinf_lib` without segfaulting the jvm.

@mkristian
Copy link
Member

@atambo hmm. when removing them you need to replace them with empty jars. not sure about the last error.

not moving the jars would be the better option but it fails with the segfault. I remember seeing this before.

@mkristian
Copy link
Member

@atambo I think reverse the class loader lookup with -Djruby.classloader.delegate=false

@kares
Copy link
Member

kares commented Jun 14, 2016

this might turn out to be yet another specific case caused by the IBM JVM+WebSphere combo ... if Kristian's shoots turn out to be a dead end it would be interesting to know whether 1.7.25 + JRuby-OpenSSL work fine (there's the forced jar-dependency which might not be there in 1.7.25's JOSSL)

@mkristian
Copy link
Member

@kares FYI: I did see the segfault when the OSGi container provided the BC jars 1.52 for all bundles.

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

@mkristian So when I try -Djruby.classloader.delegate=false and move_jars_to_webinf_lib=false I get the segfault.

However, when I add jruby.openssl.load.jars=false I don't segfault and instead get this error:

LoadError: load error: jopenssl/load -- java.lang.NoClassDefFoundError: org.bouncycastle.operator.DigestAlgorithmIdentifierFinder
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/jruby-openssl-0.9.17-java/lib/openssl.rb:1
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:1
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/activesupport-4.1.15/lib/active_support/key_generator.rb:2
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:1
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails/application.rb:4
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:1
  require at org/jruby/RubyKernel.java:944
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/railties-4.1.15/lib/rails.rb:11
  require at org/jruby/RubyKernel.java:944
   (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1
   (root) at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/gems/gems/actionpack-4.1.15/lib/action_controller/railtie.rb:1
    <top> at /opt/ibm/WEX/AppBuilder/wlp/usr/servers/AppBuilder/apps/AppBuilder/WEB-INF/config/application.rb:1

So this is definitely related to whenever this code block runs the jvm ends up segfaulting: https://github.com/jruby/jruby-openssl/blob/master/lib/jopenssl/load.rb#L7

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

@mkristian do you know of some way to isolate my application from the container's bouncy castle jars?

@mkristian
Copy link
Member

@atambo the only thing I know to separate from the underlying container is this classloader.delegate. are you sure there is another BC on websphere ? which version ? did you try jruby-openssl-0.9.14 which comes with an older BC version ?

@atambo
Copy link
Member Author

atambo commented Jun 14, 2016

@mkristian I'm not sure if there is another BC on websphere, I just thought that your comment above to @kares was stating that maybe BC is bundled inside of websphere.

I tried using jruby-openssl-0.9.13 which seems to be the release before 1.54 was made default and the jvm still segfaults.

So I guess where I'm at now is that whenever bouncy castle gets loaded the jvm segfaults.

@mkristian
Copy link
Member

@atambo two last shots in the dark:

  • put the BC jars into WEB-INF/lib and jruby.openssl.load.jars=false
  • turn off JIT jruby.compile.mode=OFF

@bruceadams
Copy link
Contributor

The little bit of Java call stack that can be gleaned from IBM Java's javacore*.txt is this:

org/jruby/runtime/Helpers.throwsUnchecked(Helpers.java:2596)
org/jruby/runtime/Helpers.throwException(Helpers.java:2591)
org/jruby/runtime/CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:158(Compiled Code))
org/jruby/runtime/BlockBody.yield(BlockBody.java:110(Compiled Code))
org/jruby/runtime/Block.yield(Block.java:167(Compiled Code))
Unable to walk in-flight data on call stack

The crash is bad enough that this stack might be wrong, although we've seen the exact same stack trace twice. (I'm in the same office with @atambo.)

@atambo
Copy link
Member Author

atambo commented Jun 15, 2016

@mkristian so when I try putting the BC jars into WEB-INF/lib and jruby.openssl.load.jars=false the jvm segfaults.

When I also add -Djruby.compile.mode=OFF things work.

So it is something to do with the JIT + the BC jars. @headius any ideas on how I can try to track down the ibm jdk/jruby JIT issues?

@mkristian
Copy link
Member

@atambo maybe the default warbler config does work as well with -Djruby.compile.mode=OFF, i.e. keep the BC jars where they are and no jruby.openssl.load.jars=false setting

@atambo
Copy link
Member Author

atambo commented Jun 15, 2016

@mkristian so using the default warbler config (not doing jruby.openssl.load.jars=false or move_jars_to_webinf_lib) with -Djruby.compile.mode=OFF and things work.

So it looks like the real issue is that the JRuby JIT + jruby-openssl crashes the IBM JVM. I'm going to collect all the javacore dump files and make them available and also try upgrading the IBM JDK and see if that fixes anything.

@atambo
Copy link
Member Author

atambo commented Jun 15, 2016

So I tried with the newest IBM JDK and the crash still happens. I also tried with Oracle JDK 8 and Open JDK 8 and they both run fine without crashing. I've submitted the below debugging information to the IBM JDK folks but here it is as well if anybody knows how to read this stuff:

websphere logs:
http://alextambellini.com/debug/console.log
http://alextambellini.com/debug/messages.log

/var/log/messages:
http://alextambellini.com/debug/system_messages.txt

java dump stuff:
http://alextambellini.com/debug/javacore.20160615.160251.9932.0002.txt
http://alextambellini.com/debug/core.20160615.160251.9932.0001.dmp
http://alextambellini.com/debug/core.20160615.160251.9932.0001.dmp.zip
http://alextambellini.com/debug/jitdump.20160615.160251.9932.0004.dmp
http://alextambellini.com/debug/Snap.20160615.160251.9932.0003.trc

@atambo atambo changed the title LoadError: load error: jopenssl/load -- java.lang.NoSuchMethodError: org/jruby/gen/org$jruby$ext$openssl$OpenSSL$POPULATOR.populateMethod IBM JRE crashes with jruby 9.1.2.0 when JRuby JIT is enabled Jun 15, 2016
@bruceadams
Copy link
Contributor

bruceadams commented Jun 17, 2016

This turns out to be easy to reproduce. With JRuby 9.1.2.0 on your PATH for ruby and gem (you may use any modern Java for these steps):

gem install rails warbler
rails new testJ9
cd testJ9
warble
docker run -p 9080:9080 -it --rm -v $PWD:/rails websphere-liberty /bin/bash

Note: the docker command above will get and run this image: https://hub.docker.com/_/websphere-liberty/ Continuing on: at the bash prompt inside the Docker container:

cp /rails/testJ9.war /config/dropins
/opt/ibm/docker/docker-server run defaultServer &

# ... Wait for a message like: CWWKZ0001I: Application testJ9 started in 437.179 seconds.

wget localhost:9080/testJ9/

💥 WLP will crash with a final message something like:

JVMDUMP013I Processed dump event "gpf", detail "".

@headius
Copy link
Member

headius commented Jul 12, 2016

The thread that crashes appears to in the process of re-raising an exception using Helpers.throwUnchecked, which uses a generics trick to throw exceptions without declaring them in a throws clause. I wouldn't expect this to cause problems for any JVM (checked exceptions is usually just implemented as a check in javac) but perhaps IBM makes assumptions that Hotspot does not?

Maybe @mstoodle or @charliegracie can route us to someone that can read these J9 crash reports and tell us if we're doing something J9 can't deal with?

@headius headius added this to the JRuby 9.1.3.0 milestone Jul 12, 2016
@atambo
Copy link
Member Author

atambo commented Jul 12, 2016

For the IBM people the PMR number is 72179,001,866.

@charliegracie
Copy link

Thanks for adding the PMR #. I will talk with folks in the morning to check the status. I will also try to reproduce locally.

@charliegracie
Copy link

I was able to reproduce it easily. It is nice to have a reproducible test case. The IBM JVM is crashing while walking the threads stack to build the exception. It is crashing while getting the details for a JIT'd frame I believe. I will dig a bit deeper to see if I can figure out what is wrong with this frame. I am also attempting to write a much simpler test case.

@headius
Copy link
Member

headius commented Jul 12, 2016

@charliegracie Thanks very much! Let us know if there's something we need to change. We do use some peculiar class/method names to encode Ruby identifiers, but according to my understanding of the JVM spec they should all be kosher.

@charliegracie
Copy link

I was not able to create a simpler test case. I have taken the investigation as far as I can on my own. Discussing it further with the folks who own the PMR and are responsible for the code which is crashing.

@headius
Copy link
Member

headius commented Aug 11, 2016

@charliegracie @mstoodle @DanHeidinga Thanks again for your help. Any luck? If there's something simple I can change to make J9 happy, that's an option too. We are hoping to put out JRuby 9.1.3.0 in the next week or so.

@headius
Copy link
Member

headius commented Aug 18, 2016

Punting to 9.1.4.0 in hopes that our IBM friends can help us then :-)

@headius headius modified the milestones: JRuby 9.1.4.0, JRuby 9.1.3.0 Aug 18, 2016
@DanHeidinga
Copy link

We had a bit of breakthrough on this today and believe that we know the root cause of the issue: interpreter -> jit state transition data is being overwritten when dropping to the stack frame for the method that handles the exception being thrown.

For anyone running into this issue, we do have a workaround that applies to this test: run with "-Xjit:exclude={*.yield*}". This will have obviously have negative performance implications....

A real fix will require changes to J9. I'll update this again when we have the fix in hand.

@headius
Copy link
Member

headius commented Aug 19, 2016

@DanHeidinga So I'm right in thinking there's nothing we need to change, right? This is just a lucky shape of code that triggers your issue?

@headius
Copy link
Member

headius commented Aug 19, 2016

I'm going to remove release milestone from this since it's sounding like there's nothing on our end to change. We are happy to have a resolution in sight!

@headius headius modified the milestones: Non-Release, JRuby 9.1.4.0 Aug 19, 2016
@DanHeidinga
Copy link

@headius Agreed, this is purely a JVM bug. No JRuby changes required.

@atambo
Copy link
Member Author

atambo commented Sep 6, 2016

Looks like this is now fixed: http://www-01.ibm.com/support/docview.wss?uid=swg1IV88798

Fix will be released in IBM JRE 8.0.3.20.

@atambo atambo closed this as completed Sep 6, 2016
@headius
Copy link
Member

headius commented Sep 6, 2016

@atambo Thank you for following up! Woohoo!

@karlhe
Copy link

karlhe commented Apr 6, 2019

@atambo Sorry to dig up an ancient thread, have you tried upgrading to JRuby 9.2.5.0 or 9.2.6.0?

I previously ran into the same issue as you (which was resolved with JRE update), now running into a similar issue that can also be worked around by disabling JIT. Previously 9.2.0.0 still worked OK.

@atambo
Copy link
Member Author

atambo commented Apr 6, 2019

Sorry @karlhe, I no longer work at IBM on the product that was using websphere and jruby so I haven't done any upgrading. If you work for IBM there is an internal website where you can report the segfault.

@karlhe
Copy link

karlhe commented Apr 13, 2019

@atambo I unfortunately don't work for IBM anymore either, but thanks anyway :)

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

8 participants