Display verification error on retransformations

Chen Liang chen.l.liang at oracle.com
Thu Aug 15 21:52:25 UTC 2024


Unfortunately, ClassFile API is not used to produce verification error messages by hotspot.  You can use ClassFile.verify to verify after generating a class if you encounter an error, or toggle the verification or bytecode dumping in your application with a system property for easier reproduction and debugging. For more serviceability questions, you can ask about instrumentation and such at serviceability-dev list.

Chen
________________________________
From: classfile-api-dev <classfile-api-dev-retn at openjdk.org> on behalf of Rafael Winterhalter <rafael.wth at gmail.com>
Sent: Thursday, August 15, 2024 4:33 PM
To: classfile-api-dev <classfile-api-dev at openjdk.org>
Subject: Display verification error on retransformations

Hello,

if a Java agent fails to retransform due to a verification error (using Instrumentation.retransformClasses), this error does not contain a message. This is like it used to be for all verification errors, when a class was loaded for the first time, but this feature of displaying a message and byte code was added later. I understand that retransformation might trigger multiple classes where many of them could be faulty, but even if only the first error is displayed (and possibly the name of the class in question), this would be of great help when debugging.

This might not even be the right mailing list for this, but as you are touching class files and since this API likely will be used to implement agents, possibly this mail just meets the right people to ask for a background? Is this a feature that was considered for the JVM?

Thanks, Rafael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20240815/a3ae5802/attachment.htm>


More information about the classfile-api-dev mailing list