RFR: JDK-8174994: SA: clhsdb printmdo throws WrongTypeException when attached to a process with CDS

Ioi Lam ioi.lam at oracle.com
Tue Apr 17 05:39:59 UTC 2018


The changes look good to me.

I agree with Coleen. Maybe FileMapHeader should be moved to a common 
file that can be included in all the ps_core files, as well as the VM's 
filemap.hpp?

Thanks

- Ioi


On 4/13/18 8:35 AM, coleen.phillimore at oracle.com wrote:
>
> This change seems good.
>
> http://cr.openjdk.java.net/~jgeorge/8174994/webrev.00/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c.udiff.html 
>
>
> It seems that you have three copies of this code.  Can you file an RFE 
> to consolidate these?
>
> thanks,
> Coleen
>
> On 4/12/18 12:21 AM, Jini George wrote:
>> Ping: Gentle reminder !
>>
>> Thanks,
>> Jini.
>>
>> On 4/6/2018 9:51 PM, Jini George wrote:
>>> Hello!
>>>
>>> Requesting reviews for: 
>>> https://bugs.openjdk.java.net/browse/JDK-8174994
>>> Webrev: http://cr.openjdk.java.net/~jgeorge/8174994/webrev.00/
>>>
>>> While trying to identify the type given an address, a 
>>> WrongTypeException was getting thrown with various clhsdb commands 
>>> (like printmdo, jstack, etc). This was since SA tries to map an 
>>> address to a hotspot C++ type by comparing the vtable address to the 
>>> vtable address values of known types. With CDS, since the vtables 
>>> are copied over for the Metadata classes, the vtable addresses 
>>> themselves don't match (though, of course, the contents will), and 
>>> SA errors out.
>>>
>>> The fix has been implemented by making changes to read in the md 
>>> region (consisting of the c++ vtables) of the CDS archive in SA, and 
>>> mapping the vtable addresses to the corresponding metadata type 
>>> (ConstantPool, InstanceKlass, InstanceClassLoaderKlass, 
>>> InstanceMirrorKlass, InstanceRefKlass, Method, ObjArrayKlass, 
>>> TypeArrayKlass).
>>>
>>> For corefiles, an additional modification has been done to have the 
>>> replicated FileMapHeader structure (from 
>>> src/hotspot/share/memory/filemap.hpp, which is replicated in SA in 
>>> ps_core.c), to be in sync with the corresponding definition in 
>>> src/hotspot/share/memory/filemap.hpp.
>>>
>>> Test cases to test both live and corefile debugging are being added 
>>> with this. These and other SA tests pass on Mach5.
>>>
>>> Thanks,
>>> Jini.
>



More information about the hotspot-runtime-dev mailing list