Work around jvm crash on early 1.8 - #4345
Conversation
| instrumentation.retransformClasses(c); | ||
| return transformer.hookInserted; |
There was a problem hiding this comment.
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.
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
trask
left a comment
There was a problem hiding this comment.
@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 |
|
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.checkAndLoadMainso we can run our agent startup right before main where using lambdas doesn't cause issues.