RFR: 8224852: JVM crash on watched field access from native code [v3]

Leonid Mesnik lmesnik at openjdk.org
Tue Oct 21 20:32:12 UTC 2025


> The field access/modification events set interp only mode and compiled frame is not expected. However JNI might call `post_field_access_by_jni` while the last java frame is compiled. 
> 
> 1) The thread switched to interponly mode while it is in JNI code. The deoptimization is triggered but each frame is really changed only execution returns to it.  So last java frame was not executed and thus is still compiled. 
> 2) The JNI accessed field from the thread where field events are not enabled. So the `post_field_access_by_jni` is called in threads in interp_only mode. 
> 
> The original example doesn't reproduce issue because of JDK changes and I don't know of it is 1) or 2)I. I implemented regression test for both problems. 
> 
> The location should be zero for JNI access.

Leonid Mesnik has updated the pull request incrementally with three additional commits since the last revision:

 - completed renaming
 - renamed test
 - updated after feedback

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27584/files
  - new: https://git.openjdk.org/jdk/pull/27584/files/bb5837ec..8662725f

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

  Stats: 74 lines in 4 files changed: 17 ins; 41 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/27584.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27584/head:pull/27584

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


More information about the serviceability-dev mailing list