-
Notifications
You must be signed in to change notification settings - Fork 72
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
Cannot attach Log4jHotPatch
agent to official releases of Jenkins
#53
Comments
Hi Basil, I am not sure replying is spam here or not but either way! Is there any solution on this? |
@mohammad-eghlima Based on my analysis above, this is a problem with |
Thanks Basil, I replaced the Corretto jdk 8 with OpenJdk-8 and it solved the issue. |
We worked around this problem in Jenkins 2.358 by moving our main class into the |
Note: All instructions here assume Java 11 (OpenJDK), but I was also able to reproduce the issue with Java 8 (OpenJDK).
Steps to reproduce
.war
).java -jar jenkins.war
.Log4jHotPatch
and runjava -Dlog4jFixerVerbose=true -cp Log4jHotPatch.jar Log4jHotPatch ${JENKINS_PID}
.Expected results
Note: These are the actual results with a local (non-official) build of Jenkins:
The
Log4jHotPatch
agent is attached successfully.Actual results
The
Log4jHotPatch
agent cannot be attached:The Jenkins logs show:
Evaluation
Stepping through the problematic frames in the debugger, I do not think Jenkins is at fault here. Jenkins contains some classes in the unnamed package namespace:
Note that
META-INF/JENKINS.RSA
andMETA-INF/JENKINS.SF
are only present in our signed official releases; a local build will not contain these. The presence of these classes and signatures means that the system class loader associates the signatures with the unnamed package namespace. Then, whenLog4jHotPatch
attempts to load a class into the same unnamed package namespace without a signature, class loading fails.I do not think
Log4jHotPatch
should make any assumptions about whether or not it is free to load unsigned classes into the unnamed package namespace. PerhapsLog4jHotPatch
should use its own package namespace instead.The text was updated successfully, but these errors were encountered: