RFR: 8330303: Crash: assert(_target_jt == nullptr || _target_jt->vthread() == target_h()) failed [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Wed Apr 24 00:29:39 UTC 2024


> This is a simple fix of three similar asserts.
> The `_target_jt->jvmti_vthread()` has to be used instead of `_target_jt->vthread()`. 
> The `_target_jt->vthread()` can be outdated in some specific contexts as shown in the `hs_err` stack trace.
> 
> I've seen similar issue and already fixed it in this fragment of code:
> 
> class GetCurrentLocationClosure : public JvmtiUnitedHandshakeClosure {
>   . . .
>   void do_vthread(Handle target_h) {
>     assert(_target_jt == nullptr || !_target_jt->is_exiting(), "sanity check");
>     // use jvmti_vthread() as vthread() can be outdated
>     assert(_target_jt == nullptr || _target_jt->jvmti_vthread() == target_h(), "sanity check");
>     . . .
> 
> The issue above was fixed by replacing `_target_jt->vthread()` with `_target_jt->jvmti_vthread()`.
> 
> There are three places which need to be fixed the same way:
>  - `GetSingleStackTraceClosure::do_vthread(Handle target_h)`
>  - `SetForceEarlyReturn::do_vthread(Handle target_h)`
>  - `UpdateForPopTopFrameClosure::do_vthread(Handle target_h)`
> 
> Testing:
>  - Run mach5 tiers 1-6

Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:

  review: updated same clarifying comment in several spots

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18806/files
  - new: https://git.openjdk.org/jdk/pull/18806/files/55a8ed10..6ac3b54f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18806&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18806&range=00-01

  Stats: 8 lines in 3 files changed: 4 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/18806.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18806/head:pull/18806

PR: https://git.openjdk.org/jdk/pull/18806


More information about the serviceability-dev mailing list