RFR: 8352414: JFR: JavaMonitorDeflateEvent crashes when deflated monitor object is dead

David Holmes dholmes at openjdk.org
Wed Mar 19 21:57:07 UTC 2025


On Wed, 19 Mar 2025 20:31:24 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Little regression crept in with [JDK-8351142](https://bugs.openjdk.org/browse/JDK-8351142): on the deflation path, object associated with monitor can be already dead. The event wants to record it, touches the dead object and crashes. The fix is simple: since we cannot infer any useful information from the event, we just skip the event emit.
>> 
>> A new stress test fails within seconds without a fix. It also covers other monitor events, so we have extra coverage there as well.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 server fastdebug, new stress test now passes
>>  - [x] Linux x86_64 server fastdebug, `jdk_jfr`
>
> src/hotspot/share/runtime/objectMonitor.cpp line 844:
> 
>> 842:   }
>> 843: 
>> 844:   if (obj != nullptr && event.should_commit()) {
> 
> So you decided to just drop the event completely ... but is that what people tracking these events would want? Do we need to update anything on the event definition so people know this is the case?

Being a replacement for the `_sync_Deflations` counter it should probably count these null ones too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24121#discussion_r2004369814


More information about the hotspot-dev mailing list