RFR: 8354523: runtime/Monitor/SyncOnValueBasedClassTest.java triggers SIGSEGV [v3]
Roman Kennke
rkennke at openjdk.org
Wed Apr 16 15:16:06 UTC 2025
> When DiagnoseSyncOnValueBasedClasses is != 0, then we can take the slow-path without having cleared the monitor cache in the BasicLock. This would later lead to a crash or other unexpected behaviour. This can happen with C1 or the interpreter, C2 has the DiagnoseSyncOnValueBasedClasses-block after clearing the cache, and the native-entry in sharedRuntime_x86_64.cpp does not have a DiagnoseSyncOnValueBasedClasses-block at all.
>
> The proposed fix so far is a bit ugly because it repeats the clearing code in 3 places. The alternative would be to move the DiagnoseSyncOnValueBasedClasses-block into MA::lightweight_lock(), but this would bring DiagnoseSyncOnValueBasedClasses-handling into the native entry in sharedRuntime_x86_64.cpp, which is currently not the case. Also, we don't have enough regs for that, but we can probably use rscratch1 now that 32-bit is gone (as is already done in C1 and interpreter paths anyway).
>
> I'd first settle on the structure, and then implement the same thing for aarch64.
> ping @xmas92
Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
Move DiagnoseSyncOnValueBasedClasses handling into MA::lightweight_lock()
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24660/files
- new: https://git.openjdk.org/jdk/pull/24660/files/56006f3e..373a5114
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24660&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24660&range=01-02
Stats: 42 lines in 5 files changed: 19 ins; 22 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24660.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24660/head:pull/24660
PR: https://git.openjdk.org/jdk/pull/24660
More information about the hotspot-dev
mailing list