-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.VerifyError in bytebuddy when installing agent jar to bootstrap classloader #1731
Comments
Could you try bumping Byte Buddy to the latest version first: https://github.com/ziyilin/type-pollution-agent/blob/install-bootstrap/agent/pom.xml#L16 |
Updated Byte Buddy to the latest(1.15.10). The
|
It seems like Byte Buddy is both on the class path and on the boot loader in the same namespace. That will not work as the class loader version will query downwards and resolve classes on a different class loader. You will have to shade Byte Buddy for this during your build, that is move the classes to a different namespace. |
The type pollution agent is used to detect a JDK performance bug.
We tried to apply for our application. But we need to modify it a little to install the agent jar to the bootstrap classloader to fit our application's requirement. One of our middleware loads all the classes with its own classloader. The agent classes should be installed to the bootstrap classloader, otherwise the middleware issues an
ClassNotFoundException
.But the agent reports the
VerifyError
from bytebuddy once is installed to bootstrap classloader. The stack trace is:I know it might not an issue of bytebuddy. But I have no idea how to get it work with bytebuddy. Any help will be appreciated.
How to Reproduce:
Our modification for the agent is here. The JDK version is 11.
git clone [email protected]:ziyilin/type-pollution-agent.git
git checkout install-bootstrap -b install-bootstrap
mvn clean package
java -javaagent:agent/target/type-pollution-agent-0.1-SNAPSHOT.jar -jar example/target/type-pollution-example-0.1-SNAPSHOT.jar
java -javaagent:agent/target/type-pollution-agent-0.1-SNAPSHOT.jar -Dio.type.pollution.bootstrap=true -jar example/target/type-pollution-example-0.1-SNAPSHOT.jar
The text was updated successfully, but these errors were encountered: