[14] RFR(S): 8225670: compiler/types/correctness/* tests fail with "assert(recv == __null || recv->is_klass()) failed: wrong type"

Christian Hagedorn christian.hagedorn at oracle.com
Thu Aug 8 11:38:10 UTC 2019


Please review the following patch:

As I reproduced the bug with [1], recv still pointed to an InstanceKlass 
object at some point which was not translated to a ciInstanceKlass and 
therefore the is_klass() check was false which made the assert fail. The 
problem can be traced back to the concurrent forced clearing of method 
data [6] using the whitebox API while compilation uses this profile data 
to create a ciProfileData wrapper. The profile data, lets say 'pd', is 
first completely copied [2] and then translated [3] to a ci version 
'cipd'. Therefore, 'cipd' initially only contains InstanceKlass entries. 
During this translation, we read instanceKlasses from 'pd' [4] and 
translate them into ciInstanceKlasses to store them in 'cipd'. However, 
while translating, [6] can delete a non-NULL InstanceKlass entry in 'pd' 
by setting it to NULL. As a result, the non-NULL check [5] fails and 
nothing is updated in 'cipd'. 'cipd' still contains a non-translated 
non-NULL InstanceKlass entry from 'pd' which later triggers the 
assertion failure.

The fix is straight forward to also clear an entry in the ciProfileData 
object if a klass is NULL in the ProfileData object. One question 
remains that I could not figure out yet: Can the method profile data be 
cleared while a method is compiled or is this only a problem specific to 
this test using a forced clear through the whitebox API?


Best regards,


More information about the hotspot-compiler-dev mailing list