adoptium / adoptium-support

For end-user problems reported with our binary distributions
Apache License 2.0
46 stars 15 forks source link

JDK 17 crashes when running Payara with APM agent #588

Open albanf opened 2 years ago

albanf commented 2 years ago

Please provide a brief summary of the bug

When deploying an application to Payara 5.2022.3 with the AppDynamics agent, the JVM crashes.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff25a01ca50, pid=178, tid=279
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.4.1+1 (17.0.4.1+1) (build 17.0.4.1+1)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (17.0.4.1+1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x82fa50]  java_lang_String::create_from_symbol(Symbol*, JavaThread*)+0x20
#
# Core dump will be written. Default location: /opt/payara/glassfish/domains/domain1/config/core.178
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#

Please provide steps to reproduce where possible

No response

Expected Results

No crash

Actual Results

It crashes. I found a similar bug report on the Jetbrains JDK 17: https://youtrack.jetbrains.com/issue/JBR-4697/Generic-SIGSEGV-at-libjvm-javalangStringcreatefromsymbol

What Java Version are you using?

OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (17.0.4.1+1, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)

What is your operating system and platform?

Alpine Linux 3.16.2, running in Docker.

How did you install Java?

From base Docker image eclipse-temurin:17.0.4.1_1-jdk-alpine

Did it work before?

It works with JDK 11 (base image eclipse-temurin:11.0.15_10-jdk-alpine)
It works when the AppDynamics agent is disabled, or when running AppDynamics with option `-Dappdynamics.agent.disable.retransformation=true`, so it seems related to class transformation.

Did you test with other Java versions?

No response

Relevant log output

No response

albanf commented 2 years ago

fargate-jdk-17-crash.log

karianna commented 2 years ago

@albanf I assume you've submitted this to AppDynamics? Like most APMs they bytecode weave etc so that's usually the first port of call for a possible root cause and fix :-)

albanf commented 2 years ago

@karianna Yes I have, and they provided me with a workaround to limit the class transformations done by the agent. But as I understand, the agent does not contain any native code, so whatever it does, the JVM should not crash as a result of its operation, right? See also their comment for a similar issue a couple of years ago: https://community.appdynamics.com/t5/Java-Java-Agent-Installation-JVM/JVM-crash-with-AppD-agent-and-G1GC/td-p/31412