RFR: 8245120: JFR: Parser unable to return typed version

Markus Gronlund markus.gronlund at oracle.com
Mon May 25 13:10:07 UTC 2020


Looks good.

Thanks
Markus

-----Original Message-----
From: Erik Gahlin 
Sent: den 25 maj 2020 14:51
To: hotspot-jfr-dev <hotspot-jfr-dev at openjdk.java.net>
Subject: RFR: 8245120: JFR: Parser unable to return typed version

Hi,

Could I have a review of a fix that prevents a ClassCastException when using Event Streaming.

Thread constants are in some scenarios emitted twice for the same chunk, which means the value will be parsed twice. This does not typically happen in JFR, since we want to keep files as compact as possible, but if it happens, the second version replaces the first. 

The value is however still tagged as resolved, which means a conversion from Object[] to RecordedThread never happen for the second version. This leads to ClassCastException when the raw value (Object[]) can’t be casted to a typed version, i.e RecordedThread, in the API.

Fix is to clear tagging if a value already exists.

Bug:
https://bugs.openjdk.java.net/browse/JDK-8245120

Webrev:
http://cr.openjdk.java.net/~egahlin/8245120/

Testing: jdk/jdk/jfr 

During testing I modified the parser so it verifies there are no unresolved objects (Object[]) for know types, such as RecordedThread and RecordedClass, when running tests in jdk/jdk/jfr

Thanks
Erik


More information about the hotspot-jfr-dev mailing list