RFR: 8314225: SIGSEGV in JavaThread::is_lock_owned

Kevin Walls kevinw at openjdk.org
Thu Jan 25 21:38:59 UTC 2024


JavaThread's _monitor_chunks member is temporary storage used by deoptimization.
When other threads inspect it using JavaThread::monitor_chunks(), if it is non-null that means a deoptimization is in progress, and the value will be removed shortly.

There are a few places where we attempt to follow the MonitorChunk*, but that would only be valid if deopt is in progress, and only safe if we could know the deopt is not going to complete.  But that the deopt will complete, and will free the MonitorChunks and clear the value.  So this is rare but there is a race and a risk of following a MonitorChunk* as it gets freed, and crashing.

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

Commit messages:
 - (C)
 - Check for null to avoid handshake or safepoint check
 - 8314225: SIGSEGV in JavaThread::is_lock_owned

Changes: https://git.openjdk.org/jdk/pull/17566/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17566&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314225
  Stats: 38 lines in 3 files changed: 33 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/17566.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17566/head:pull/17566

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


More information about the hotspot-dev mailing list