Hello from JRuby and here's another crash
ioi.lam at oracle.com
ioi.lam at oracle.com
Fri Jul 5 04:49:57 UTC 2024
Hi Charlie,
Thanks for the bug report.
It turns out some Leyden optimizations can't handle the module options
specified by jruby, such as these:
--add-opens=java.base/java.nio.channels=org.jruby.dist
--module-path=/xxxx/jruby-9.4.8.0/lib/jruby.jar
I filed https://bugs.openjdk.org/browse/JDK-8335735
I'll work on a proper fix. Meanwhile, I have a work-around in this branch
https://github.com/iklam/jdk/tree/work-around-8335735-jruby-crash-due-to-lack-of-module-support
If you build a JDK from this source branch, you can see the following
improvements:
# [1] No optimizations
$ time env JAVA_HOME=$MYJAVA ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \
-e '10.times { org.jruby.Ruby.newInstance }'
real 0m3.215s
user 0m14.868s
sys 0m0.373s
# [2] Leyden
$ time env JAVA_HOME=$TBP0 ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \
-J-XX:CacheDataStore=jruby.cds \
-e '10.times { org.jruby.Ruby.newInstance }'
real 0m1.880s
user 0m9.001s
sys 0m0.268s
# [3] Compare with CDS in the JDK mainline
$ env JAVA_HOME=$MYJAVA ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \
-J-XX:DumpLoadedClassList=jruby.classlist \
-e '10.times { org.jruby.Ruby.newInstance }'
$ $MYJAVA/bin/java -Xshare:dump \
--module-path=/home/iklam/Downloads/ruby/jruby-9.4.8.0/lib/jruby.jar \
-XX:SharedClassListFile=jruby.classlist \
-XX:SharedArchiveFile=jruby.jsa -Xlog:cds
$ time env JAVA_HOME=$MYJAVA ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \
-J-XX:SharedArchiveFile=jruby.jsa \
-e '10.times { org.jruby.Ruby.newInstance }'
real 0m2.628s
user 0m13.007s
sys 0m0.428s
Please try it out and let us know if you run into other problems.
Thanks
- Ioi
On 7/4/24 1:06 PM, Charles Oliver Nutter wrote:
> Hello friends! Long time lurker, first time poster.
>
> Like others I was excited to hear that the first EA of Leyden had
> dropped. Sadly, I have another crash to report.
>
> I see there are two other crashes reported, but mine appears different
> (ClassPrelinker::is_indy_resolution_deterministic):
>
> https://gist.github.com/headius/79c6460ed55c1d80c82e1c0209897e24
>
> Perhaps unsurprisingly, the additional flags provided by Vladimir
> Kozlov (-XX:+UnlockDiagnosticVMOptions -XX:-ReduceAllocationMerges)
> did not appear to change the result.
>
> This is with JRuby's minimally invokedynamic-based mode, which has
> given us the shortest startup time in the past (second only to
> disabling tiers 2-4 and staying in C1).
>
> I am on MacOS AArch64 Sonoma 14.5, testing against JRuby master, but
> reproduction should be as easy as downloading the JRuby binary
> tarball, unpacking, and running bin/jruby with the command line above.
>
> https://www.jruby.org/download
>
> I am eager to work with Leyden folks to investigate issues, and I am
> planning to be at JVMLS this year to discuss collaborating more!
>
> - Charlie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20240704/9c54a64c/attachment.htm>
More information about the leyden-dev
mailing list