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

Erik Gahlin erik.gahlin at oracle.com
Mon May 25 16:18:08 UTC 2020


Great, and thanks for testing it out!

Erik

> On 25 May 2020, at 17:41, Jean-Philippe Bempel <jean-philippe.bempel at datadoghq.com> wrote:
> 
> Hi Erik,
> 
> I have tested your fix on my application reproducing the bug with all
> events from 'default' profile, works fine!
> 
> Thanks
> 
> On Mon, May 25, 2020 at 2:51 PM Erik Gahlin <erik.gahlin at oracle.com> wrote:
>> 
>> 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