# JVM crash with Java 17.0.2 + Agent 1.26.0

**URL:** <https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890>\
**Category:** APM\
**Tags:** java\
**Created:** [May 30, 2022, 3:39am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890 "2022-05-30T03:39:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rekadowney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rekadowney/32/106313_2.png) [@rekadowney](https://discuss.elastic.co/u/rekadowney)\
**Post date:** [May 30, 2022, 3:39am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/1 "2022-05-30T03:39:48Z")

</div>

Our application run in K8S, and found serveral restart event with jvm crash.  
[crash\_file](https://github.com/elastic/apm-agent-java/files/8795244/3-hs_err_pid1.log)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e479846e6b39040eb0190fcaf34f007eec4e1c36.png)

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [May 30, 2022, 11:25am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/2 "2022-05-30T11:25:24Z")

</div>

Hi @rekadowney ,

Since you are not using the latest version of the agent, the first thing to check would be to test with the latest version (`1.31.0` currently).

Then, if the issue persists, could you provide a bit more context for further investigation:

- agent configuration (should be visible in the first few lines of app or agent logs).
- what is the frequency of those crashes ?
- did the issue happened before with a different version of the JVM ?

From what we can see in the crash report, the crash seems to be related to a bug in GC code `V [libjvm.so+0x705234] G1ParScanThreadState::trim_queue_to_threshold(unsigned int)+0x14d4`, so there is no direct impact from the agent visible here.

---

<div class="post-metadata">

**Author:** ![rekadowney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rekadowney/32/106313_2.png) [@rekadowney](https://discuss.elastic.co/u/rekadowney)\
**Post date:** [May 31, 2022, 2:44am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/3 "2022-05-31T02:44:10Z")

</div>

I found a similar [JDK bug](https://bugs.openjdk.java.net/browse/JDK-8273304) in the `JDK Bug System`, but this bug is only reported to be found and fixed in JDK18, do you think I should report the same problem in JDK17?

We will try to upgrade the agent to `1.31.0`. I don't remember if JDK8(using PS GC) has the same problem, because of lack of jvm crash monitoring, we will improve it later.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [May 31, 2022, 8:13am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/4 "2022-05-31T08:13:14Z")

</div>

If this issue also happens in Jdk 17, it would be worth to also report it.  
Given 17 is an LTS version, it means if the issue is confirmed it would likely be fixed.

The reason I was asking for your agent configuration is to know if you are using the sampling profiler which could trigger similar crashes (often inirectly by triggering JVM bugs). From your report it does not seem to be enabled but it's better to double check here.

From what I understand, you used to run your application on JDK 8 previously, but you don't know if such crashes were happening or not.

---

<div class="post-metadata">

**Author:** ![rekadowney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rekadowney/32/106313_2.png) [@rekadowney](https://discuss.elastic.co/u/rekadowney)\
**Post date:** [June 1, 2022, 1:43am UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/5 "2022-06-01T01:43:19Z")

</div>

> [@Sylvain\_Juge](#):
>
> If this issue also happens in Jdk 17, it would be worth to also report it.  
> Given 17 is an LTS version, it means if the issue is confirmed it would likely be fixed.

Next week we will upgrade agent to 1.31.0, I will consider report it based on the result.

> [@Sylvain\_Juge](#):
>
> The reason I was asking for your agent configuration is to know if you are using the sampling profiler which could trigger similar crashes (often inirectly by triggering JVM bugs). From your report it does not seem to be enabled but it's better to double check here.

The agent configuration like this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/8/4862ac80e0d7351136a759a9e67ba341a2b4fbfa.png)

> [@Sylvain\_Juge](#):
>
> From what I understand, you used to run your application on JDK 8 previously, but you don't know if such crashes were happening or not.

You are right, our monitor system will support crash monitoring in the near future.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2022, 9:43pm UTC](https://discuss.elastic.co/t/jvm-crash-with-java-17-0-2-agent-1-26-0/305890/6 "2022-06-21T21:43:33Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
