<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<font face="monospace">Hi Charlie,<br>
<br>
Thanks for the bug report.<br>
<br>
It turns out some Leyden optimizations can't handle the module
options specified by jruby, such as these:<br>
<br>
--add-opens=java.base/java.nio.channels=org.jruby.dist<br>
--module-path=/xxxx/jruby-9.4.8.0/lib/jruby.jar<br>
<br>
I filed <a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8335735">https://bugs.openjdk.org/browse/JDK-8335735</a><br>
<br>
I'll work on a proper fix. Meanwhile, I have a work-around in this
branch<br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/iklam/jdk/tree/work-around-8335735-jruby-crash-due-to-lack-of-module-support">https://github.com/iklam/jdk/tree/work-around-8335735-jruby-crash-due-to-lack-of-module-support</a><br>
<br>
If you build a JDK from this source branch, you can see the
following improvements:<br>
<br>
# [1] No optimizations<br>
$ time env JAVA_HOME=$MYJAVA
~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \<br>
-e '10.times { org.jruby.Ruby.newInstance }'<br>
real 0m3.215s<br>
user 0m14.868s<br>
sys 0m0.373s<br>
<br>
<br>
# [2] Leyden<br>
$ time env JAVA_HOME=$TBP0
~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \<br>
-J-XX:CacheDataStore=jruby.cds \<br>
-e '10.times { org.jruby.Ruby.newInstance }'<br>
real 0m1.880s<br>
user 0m9.001s<br>
sys 0m0.268s<br>
<br>
<br>
</font><font face="monospace"># [3] Compare with CDS in the JDK
mainline<br>
$ env JAVA_HOME=$MYJAVA ~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \<br>
-J-XX:DumpLoadedClassList=jruby.classlist \<br>
-e '10.times { org.jruby.Ruby.newInstance }'<br>
$ $MYJAVA/bin/java -Xshare:dump \<br>
--module-path=/home/iklam/Downloads/ruby/jruby-9.4.8.0/lib/jruby.jar
\<br>
-XX:SharedClassListFile=jruby.classlist \<br>
-XX:SharedArchiveFile=jruby.jsa -Xlog:cds<br>
$ time env JAVA_HOME=$MYJAVA
~/Downloads/ruby/jruby-9.4.8.0/bin/jruby \<br>
-J-XX:SharedArchiveFile=jruby.jsa \<br>
-e '10.times { org.jruby.Ruby.newInstance }'<br>
real 0m2.628s<br>
user 0m13.007s<br>
sys 0m0.428s<br>
<br>
Please try it out and let us know if you run into other problems.<br>
<br>
Thanks<br>
<br>
- Ioi</font><font face="monospace"><span style="color: rgb(23, 43, 77); font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><br>
</span></font><font face="monospace"><span style="color: rgb(23, 43, 77); font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"></span></font><br>
<font face="monospace"><br>
</font>
<div class="moz-cite-prefix"><font face="monospace">On 7/4/24 1:06
PM, Charles Oliver Nutter wrote:<br>
</font></div>
<blockquote type="cite" cite="mid:CAE-f1xSYcJudwYQUSZQxzU2nvqXnUSHLgQ69STYGMwJjsUKcsQ@mail.gmail.com">
<div dir="ltr"><font face="monospace">Hello friends! Long time
lurker, first time poster.</font>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">Like others I was excited to hear
that the first EA of Leyden had dropped. Sadly, I have
another crash to report.</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">I see there are two other crashes
reported, but mine appears different
(ClassPrelinker::is_indy_resolution_deterministic):</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"><a href="https://gist.github.com/headius/79c6460ed55c1d80c82e1c0209897e24" moz-do-not-send="true" class="moz-txt-link-freetext">https://gist.github.com/headius/79c6460ed55c1d80c82e1c0209897e24</a><br>
</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">Perhaps unsurprisingly, the
additional flags provided by Vladimir Kozlov (<span style="color:rgb(0,0,0)">-XX:+UnlockDiagnosticVMOptions
-XX:-ReduceAllocationMerges) did not appear to change the
result.</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)"><br>
</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)">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).</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)"><br>
</span></font></div>
<div><font face="monospace" color="#000000">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.</font></div>
<div><font face="monospace" color="#000000"><br>
</font></div>
<div><font face="monospace"><a href="https://www.jruby.org/download" moz-do-not-send="true" class="moz-txt-link-freetext">https://www.jruby.org/download</a><font color="#000000"><br>
</font></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)"><br>
</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)">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!</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)"><br>
</span></font></div>
<div><font face="monospace"><span style="color:rgb(0,0,0)">-
Charlie</span></font></div>
</div>
</blockquote>
</body>
</html>