[jdk17u-dev] RFR: 8352649: [17u] guarantee(is_result_safe || is_in_asgct()) failed inside AsyncGetCallTrace

Andrei Pangin apangin at openjdk.org
Sun Mar 23 22:43:26 UTC 2025


This PR fixes intermittent JVM crash at `guarantee(is_result_safe || is_in_asgct()) failed: unsafe access to zombie method` when running profiler.

This guarantee was changed in [JDK-8283849](https://bugs.openjdk.org/browse/JDK-8283849) to avoid failing in AsyncGetCallTrace context. However, after [JDK-8304725](https://bugs.openjdk.org/browse/JDK-8304725) and [JDK-8325585](https://bugs.openjdk.org/browse/JDK-8325585) it started failing again. This is because JDK-8304725 introduced another copy of `_in_asgct` field in Thread class, whereas JDK-8325585 removed setting of `_in_asgct` in JavaThread class. In this way, `AsyncGetCallTrace` sets `Thread::_in_asgct` field, but the above guarantee checks a different `JavaThread::_in_asgct` field.

This PR resolves the confusion by removing redundant `_in_asgct` field declared in `JavaThread`. Now, all code consistently sets and reads the only `_in_asgct` field declared in `Thread` class.

-------------

Commit messages:
 - JDK-8352649: [17u] guarantee(is_result_safe || is_in_asgct()) failed inside AsyncGetCallTrace

Changes: https://git.openjdk.org/jdk17u-dev/pull/3400/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3400&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8352649
  Stats: 12 lines in 3 files changed: 0 ins; 11 del; 1 mod
  Patch: https://git.openjdk.org/jdk17u-dev/pull/3400.diff
  Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3400/head:pull/3400

PR: https://git.openjdk.org/jdk17u-dev/pull/3400


More information about the jdk-updates-dev mailing list