JVM crash in JIT-compiled co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper.onAppendEnter() method

Solution Unverified - Updated

Environment

Issue

  • Tomcat crashes with the following in the Java fatal error log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fce163ff2e2, pid=2820728, tid=2838593
#
# JRE version: OpenJDK Runtime Environment (Red_Hat-17.0.6.0.10-3.el8_7) (17.0.6+10) (build 17.0.6+10-LTS)
# Java VM: OpenJDK 64-Bit Server VM (Red_Hat-17.0.6.0.10-3.el8_7) (17.0.6+10-LTS, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# J 46373 c2 co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper.onAppendEnter(Ljava/lang/Object;)Z (126 bytes) @ 0x00007fce163ff2e2 [0x00007fce163feb40+0x00000000000007a2]
#
...
Command Line: ... -javaagent:/path/to/tomcat/Elastic_APM/elastic-apm-agent.jar -Dcatalina.base=/path/to/tomcat -Dcatalina.home=/path/to/tomcat -Djava.io.tmpdir=/path/to/tomcat/temp org.apache.catalina.startup.Bootstrap start
...
Stack: [0x00007fc2c20e4000,0x00007fc2c21e5000],  sp=0x00007fc2c21e3330,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 46373 c2 co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper.onAppendEnter(Ljava/lang/Object;)Z (126 bytes) @ 0x00007fce163ff2e2 [0x00007fce163feb40+0x00000000000007a2]
J 45840 c1 co.elastic.apm.agent.jul.reformatting.JulConsoleHandlerPublishAdvice.initializeReformatting(Ljava/util/logging/ConsoleHandler;)Z (8 bytes) @ 0x00007fcdd8ac1624 [0x00007fcdd8ac1540+0x00000000000000e4]
...

Resolution

Upgrade to OpenJDK 17u13+/21u5+/25+.

Root Cause

Content from github.com is not included.SIGSEGV Tomcat 10.1 Java 17
Content from bugs.openjdk.org is not included.JDK-8322726: C2: Unloaded signature class kills argument value


This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.