premain: CGLIB error during the training run with Petclinic

ioi.lam at oracle.com ioi.lam at oracle.com
Thu Sep 12 03:07:34 UTC 2024


It seems like the error happens only when running in "training mode". 
Can you try something like this to isolate the problem?

     rm -f app.cds
     java -cp app.jar -XX:CacheDataStore -XX:+UnlockDiagnosticVMOptions 
-XX:+CDSManualFinalImage AppMain

This will make sure that the app is executed with profile collection 
enabled. The profile is written to the file foo.cds.preimage.

Normally, after foo.cds.preimage is created, we fork a sub process to 
consume foo.cds.preimage and write foo.cds. -XX:+CDSManualFinalImage 
prevents the sub process from being created.

If the above causes an error, but this doesn't (when running the exact 
same workload)

     java -cp app.jar -Xshare:off AppMain

then we know that the error is triggered by the extra work performed by 
the VM for collecting profiling information.

Thanks

- Ioi

On 9/11/24 6:02 AM, Sebastien Deleuze wrote:
> After adding more logging, I can confirm the original exception when 
> -XX:CacheDataStore is set with no existing CDS file is thrown by 
> MethodHandles.Lookup#defineClass and is similar to the second one I 
> reported.
> This is a class that Spring Data generates during runtime.
>
> java.lang.VerifyError: Bad local variable type
> Exception Details:
>   Location:
> org/springframework/samples/petclinic/owner/Owner_Accessor_yw4ckn.getProperty(Lorg/springframework/data/mapping/PersistentProperty;)Ljava/lang/Object; 
> @83: aload_2
>   Reason:
>     Type top (current frame, locals[2]) is not assignable to reference 
> type
>   Current Frame:
>     bci: @83
>     flags: { }
>     locals: { 
> 'org/springframework/samples/petclinic/owner/Owner_Accessor_yw4ckn', 
> 'org/springframework/data/mapping/PersistentProperty' }
>     stack: { 'java/lang/invoke/MethodHandle' }
>   Bytecode:
>     0000000: 2b12 7db8 0027 2ab4 0029 4d2b b900 8301
>     0000010: 00b6 0089 ab00 0000 0000 006c 0000 0006
>     0000020: a900 4641 0000 004c bb97 9bf4 0000 0054
>     0000030: 0000 0d1b 0000 003c 002e 996b 0000 005c
>     0000040: 07ea e95b 0000 0044 2eae b404 0000 0064
>     0000050: b200 4a2c b600 a5b0 b200 532c b600 a5b0
>     0000060: b200 592c b600 a5b0 b200 5f2c b600 a5b0
>     0000070: b200 652c b600 a5b0 b200 6b2c b600 a5b0
>     0000080: bb00 9159 12a7 04bd 0004 5903 2b53 b800
>     0000090: 97b7 009a bf
>   Stackmap Table:
>     same_frame_extended(@80)
>     same_frame(@88)
>     same_frame(@96)
>     same_frame(@104)
>     same_frame(@112)
>     same_frame(@120)
>     same_frame(@128)
>
> I have shared the related output I get with -Xlog:exceptions on 
> https://gist.github.com/sdeleuze/96e638dd3bb94918c545ee54fca9b8a3 in 
> case that could be useful.
>
>
> On Wed, Sep 11, 2024 at 2:51 PM Alan Bateman <alan.bateman at oracle.com> 
> wrote:
>
>     On 11/09/2024 13:16, Sebastien Deleuze wrote:
>     > Yes, it works without --add-opens and without
>     -XX:CacheDataStore, in
>     > all my use cases I never set --add-opens explicitly.
>     >
>     > There are various fallback paths, and potentially the original
>     > exception is hidden, so let me have a deeper look by comparing
>     broken
>     > and successful code paths.
>     > I will share more details in an upcoming email.
>     >
>     Maybe running with -Xlog:exceptions might reveal something.
>
>     -Alan
>
>
> This electronic communication and the information and any files 
> transmitted with it, or attached to it, are confidential and are 
> intended solely for the use of the individual or entity to whom it is 
> addressed and may contain information that is confidential, legally 
> privileged, protected by privacy laws, or otherwise restricted from 
> disclosure to anyone else. If you are not the intended recipient or 
> the person responsible for delivering the e-mail to the intended 
> recipient, you are hereby notified that any use, copying, 
> distributing, dissemination, forwarding, printing, or copying of this 
> e-mail is strictly prohibited. If you received this e-mail in error, 
> please return the e-mail to the sender, delete it from your computer, 
> and destroy any printed copy of it. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20240911/2a910d55/attachment.htm>


More information about the leyden-dev mailing list