-
Notifications
You must be signed in to change notification settings - Fork 911
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
Work around jvm crash on early 1.8 #4345
Work around jvm crash on early 1.8 #4345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any thoughts how we can add smoke test for an early 1.8 release?
instrumentation.retransformClasses(c); | ||
return transformer.hookInserted; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth checking hookInserted
before calling retransformClasses
in case Class.forName
triggered the first load? or does that not happen in practice...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'd expect it to be not loaded before the transformer is added and retransformClasses
is just a failsafe if it was unexpectedly already loaded.
I vote for NOT supporting anything before 8u40 and thus NOT introducing extra complexity. |
I'm in favor of supporting pre-8u40 if we have a way to test. Delaying startup to Let's at least hold on this until after the 1.7.0 release to give us more time to think/discuss. |
@trask do you have specific action plan/proposal for this? |
I think the added complexity is justified if we have a test for it, otherwise it feels like something that's too easy to break in the future. There are some impressively old Zulu docker images (e.g. 8u05) that could fit the bill. |
b59e91c
to
452fd73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@open-telemetry/java-instrumentation-approvers please weigh in
// Hotspot versions before 8u40 crash in jit compiled lambdas when javaagent initializes | ||
// java.lang.invoke.CallSite | ||
// This test verifies that such jvm does not crash with opentelemetry agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
3 votes in favour, 2 votes against. @laurit seems like you are free to merge :( |
* Work around jvm crash on early 1.8 * skip retransform if class was already transformed during load * fix imports after rebase * add test * disable test on windows
Resolves #4326
This pr implements a workaround for jvm crashes on oracle jvms earlier than 8u40, an alternative would be to disable agent for these jvm versions. This workaround avoids using lambdas in agent premain method by inserting a callback into
sun.launcher.LauncherHelper.checkAndLoadMain
so we can run our agent startup right before main where using lambdas doesn't cause issues.