Running Spring PetClinic with the Leyden premain branch
Volker Simonis
volker.simonis at gmail.com
Thu Sep 14 14:42:22 UTC 2023
Hi Mark, Vladimir,
Very interesting, thanks a lot for sharing!
Unfortunately the bits don't really seem to fit together. I've tried
to reproduce the example but failed for several reasons:
Slide 3 / Point 2. should read:
-Xshare:dump -XX:SharedClassListFile=<file> -XX:SharedArchiveFile=<file>
Slide 3 / Point 4.:
the -XX:+StoreCachedCode/-XX:CachedCodeFile don't exist in the
premain branch. I've tried with
-XX:SharedCodeArchive/-XX:+StoreSharedCode instead but unfortunately
got a crash at VM exit (see below).
After that I switched to the "premain-precompile" branch which has
-XX:+StoreCachedCode/-XX:CachedCodeFile but unfortunately it crashed
with the same internal error (see below).
So maybe on Slide 1 the "Samples:" link should read:
Samples: https://github.com/openjdk/leyden/tree/premain/test/hotspot/jtreg/premain-precompile
But then "premain-precompile" has no
"test/hotspot/jtreg/premain/spring-petclinic" directory ?
Slide 19:
-Xlog:scc doesn't exist in the premain branch, only -Xlog:sca. But
the "premain-precompile" branch has -Xlog:scc
Can you please be more specific with which exact branch of the Leyden
repository these examples should work?
Maybe it makes sense to put the instructions for these examples in the
OpenJDK Wiki (or at least in an .md file in the repository itself)
such that others can help to keep it up to date.
For others interested in this specific topic, which Leyden branch do
you recommend monitoring and for which branch does it make sense to
submit patches?
Thank you for the nice work and best regards,
Volker
Crash dump for "premain" branch:
# Internal Error
(/OpenJDK/Git/leyden/src/hotspot/share/services/mallocHeader.inline.hpp:102),
pid=1968868, tid=1969187
# fatal error: Not a valid malloc pointer: 0x00007ffff0034905: block
address is unaligned
#
# JRE version: OpenJDK Runtime Environment (22.0) (slowdebug build
22-internal-adhoc.simonisv.leyden)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug
22-internal-adhoc.simonisv.leyden, mixed mode, sharing, tiered,
compressed oops, compressed class ptrs, g1 gc, linux-amd64)
--------------- S U M M A R Y ------------
Command Line: -XX:SharedArchiveFile=/tmp/HelloSwing.jsa
-XX:SharedCodeArchive=/tmp/HelloSwing.jsa_code -XX:+ReplayTraining
-XX:+StoreSharedCode HelloSwing
Host: xxx, Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz, 8 cores, 31G,
Ubuntu 20.04.6 LTS
Time: Thu Sep 14 15:55:01 2023 CEST elapsed time: 56.381265 seconds
(0d 0h 0m 56s)
--------------- T H R E A D ---------------
Current thread (0x00007fffa00092e0): JavaThread "SIGINT handler"
daemon [_thread_in_vm, id=1969187,
stack(0x00007fff73eff000,0x00007fff74000000) (1028K)]
Stack: [0x00007fff73eff000,0x00007fff74000000],
sp=0x00007fff73ffe0f0, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x1158f9b] MallocHeader*
MallocHeader::resolve_checked_impl<void*, MallocHeader*>(void*)+0x5f
(mallocHeader.inline.hpp:102)
V [libjvm.so+0x1158ba8] MallocHeader::resolve_checked(void*)+0x1c
(mallocHeader.inline.hpp:113)
V [libjvm.so+0x1158320] MallocTracker::record_free_block(void*)+0xca
(mallocTracker.cpp:179)
V [libjvm.so+0x1273ba0] MemTracker::record_free(void*)+0x82
(memTracker.hpp:112)
V [libjvm.so+0x126f935] os::free(void*)+0x3f (os.cpp:776)
V [libjvm.so+0x606be0] FreeHeap(void*)+0x1c (allocation.cpp:68)
V [libjvm.so+0x367a8f] SCAFile::~SCAFile()+0xe7 (SCArchive.cpp:425)
V [libjvm.so+0x366b80] SCArchive::close()+0x2a (SCArchive.cpp:179)
V [libjvm.so+0xd665eb] before_exit(JavaThread*, bool)+0x1d5 (java.cpp:484)
V [libjvm.so+0xe92d34] JVM_Halt+0x68 (jvm.cpp:439)
C [libjava.so+0x16312] Java_java_lang_Shutdown_halt0+0x30 (Shutdown.c:41)
j java.lang.Shutdown.halt0(I)V+0 java.base at 22-internal
j java.lang.Shutdown.halt(I)V+7 java.base at 22-internal
j java.lang.Shutdown.exit(I)V+16 java.base at 22-internal
j java.lang.Terminator$1.handle(Ljdk/internal/misc/Signal;)V+8
java.base at 22-internal
j jdk.internal.misc.Signal$1.run()V+8 java.base at 22-internal
j java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5
java.base at 22-internal
j java.lang.Thread.run()V+19 java.base at 22-internal
v ~StubRoutines::call_stub 0x00007fffdfdc4d59
V [libjvm.so+0xd6acd7] JavaCalls::call_helper(JavaValue*,
methodHandle const&, JavaCallArguments*, JavaThread*)+0x60b
(javaCalls.cpp:415)
V [libjvm.so+0x1280ad4] os::os_exception_wrapper(void
(*)(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*),
JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x3a
(os_linux.cpp:4958)
V [libjvm.so+0xd6a6c8] JavaCalls::call(JavaValue*, methodHandle
const&, JavaCallArguments*, JavaThread*)+0x3e (javaCalls.cpp:329)
V [libjvm.so+0xd696d3] JavaCalls::call_virtual(JavaValue*, Klass*,
Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x1b5
(javaCalls.cpp:185)
V [libjvm.so+0xd697e5] JavaCalls::call_virtual(JavaValue*, Handle,
Klass*, Symbol*, Symbol*, JavaThread*)+0x99 (javaCalls.cpp:191)
V [libjvm.so+0xea190d] thread_entry(JavaThread*, JavaThread*)+0x92
(jvm.cpp:2922)
V [libjvm.so+0xd85102] JavaThread::thread_main_inner()+0x15c
(javaThread.cpp:721)
V [libjvm.so+0xd84f9c] JavaThread::run()+0x258 (javaThread.cpp:706)
V [libjvm.so+0x15964fe] Thread::call_run()+0x1a8 (thread.cpp:217)
V [libjvm.so+0x1276a3e] thread_native_entry(Thread*)+0x1bd (os_linux.cpp:783)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j java.lang.Shutdown.halt0(I)V+0 java.base at 22-internal
j java.lang.Shutdown.halt(I)V+7 java.base at 22-internal
j java.lang.Shutdown.exit(I)V+16 java.base at 22-internal
j java.lang.Terminator$1.handle(Ljdk/internal/misc/Signal;)V+8
java.base at 22-internal
j jdk.internal.misc.Signal$1.run()V+8 java.base at 22-internal
j java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5
java.base at 22-internal
j java.lang.Thread.run()V+19 java.base at 22-internal
v ~StubRoutines::call_stub 0x00007fffdfdc4d59
Crash for "premain-precompile" branch:
...
Stack: [0x00007ffff512a000,0x00007ffff522b000],
sp=0x00007ffff52290c0, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x1177b0f] MallocHeader*
MallocHeader::resolve_checked_impl<void*, MallocHeader*>(void*)+0x5f
(mallocHeader.inline.hpp:102)
V [libjvm.so+0x117771c] MallocHeader::resolve_checked(void*)+0x1c
(mallocHeader.inline.hpp:113)
V [libjvm.so+0x1176e94] MallocTracker::record_free_block(void*)+0xca
(mallocTracker.cpp:179)
V [libjvm.so+0x1294f30] MemTracker::record_free(void*)+0x82
(memTracker.hpp:112)
V [libjvm.so+0x1290b41] os::free(void*)+0x3f (os.cpp:776)
V [libjvm.so+0x60c2c6] FreeHeap(void*)+0x1c (allocation.cpp:68)
V [libjvm.so+0x36aa3d] SCCache::~SCCache()+0xe7 (SCCache.cpp:420)
V [libjvm.so+0x369b2e] SCCache::close()+0x2a (SCCache.cpp:174)
V [libjvm.so+0xd7d64d] before_exit(JavaThread*, bool)+0x1d5 (java.cpp:491)
V [libjvm.so+0xeaa4be] JVM_Halt+0x68 (jvm.cpp:459)
C [libjava.so+0x16312] Java_java_lang_Shutdown_halt0+0x30 (Shutdown.c:41)
j java.lang.Shutdown.halt0(I)V+0 java.base at 22-internal
j java.lang.Shutdown.halt(I)V+7 java.base at 22-internal
j java.lang.Shutdown.exit(I)V+16 java.base at 22-internal
j java.lang.Runtime.exit(I)V+14 java.base at 22-internal
j java.lang.System.exit(I)V+4 java.base at 22-internal
j HelloSwing.<init>([Ljava/lang/String;)V+79
j HelloSwing.main([Ljava/lang/String;)V+5
v ~StubRoutines::call_stub 0x00007fffdfd36d59
...
On Tue, Sep 12, 2023 at 10:12 PM Mark Reinhold <mark.reinhold at oracle.com> wrote:
>
> Here’s a short slide deck which Vladimir Ivanov prepared to show how to
> use the AOT-optimizing features in the current Leyden premain branch
> with the Spring PetClinic application:
>
> https://openjdk.org/projects/leyden/slides/leyden-premain-petclinic-2023-09-12.pdf
>
> - Mark
More information about the leyden-dev
mailing list