RFR: 8017588: SA: jstack -l throws UnalignedAddressException while attaching to core file for java that was started with CMS GC

Coleen Phillimore coleen.phillimore at oracle.com
Wed Jul 3 04:36:05 PDT 2013


Eric,

I like the cleanup of instanceKlass.cpp a lot.

In the serviceability agent,  does getHeap().getOopSize() return 32 for 
compressed oops?   The vtables and itables are Method*, ie metadata.   
Is there a better size for these?

Another set of tests that I think we run with vm.quick.testlist is the 
nsk.sajdi.testlist and the vm.tmtools.testlist in ute.

Thanks,
Coleen

On 7/3/2013 4:33 AM, Erik Helin wrote:
> Hi all,
>
> this change fixes an issue where we could not run jstack -l -F on a
> java process running with -XX:+UseConcMarkSweepGC.
>
> The problem originated from the following change in hotspot:
>   changeset:   3707:8bafad97cd26
>   parent:      3693:973046802b6f
>   7158552: The instanceKlsss::_host_klass is only needed for anonymous class for JSR 292 support.
>
>   diff --git a/src/share/vm/oops/instanceKlass.hpp b/src/share/vm/oops/instanceKlass.hpp
>   --- a/src/share/vm/oops/instanceKlass.hpp
>   +++ b/src/share/vm/oops/instanceKlass.hpp
>   @@ -717,9 +763,11 @@
>      {
>        return object_size(align_object_offset(vtable_length()) +
>                           align_object_offset(itable_length()) +
>   -                       (is_interface() ?
>   -                        (align_object_offset(nonstatic_oop_map_size()) + (int)sizeof(klassOop)/HeapWordSize) :
>   -                        nonstatic_oop_map_size()));
>   +                       ((is_interface() || is_anonymous()) ?
>   +                         align_object_offset(nonstatic_oop_map_size()) :
>   +                         nonstatic_oop_map_size()) +
>   +                       (is_interface() ? (int)sizeof(klassOop)/HeapWordSize : 0) +
>   +                       (is_anonymous() ? (int)sizeof(klassOop)/HeapWordSize : 0));
>      }
>
> The corresponding code in the serviceability agent was not updated:
>
>   agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java:
>    public long getObjectSize() {
>    long bodySize =    alignObjectOffset(getVtableLen() * getHeap().getOopSize())
>                     + alignObjectOffset(getItableLen() * getHeap().getOopSize())
>                     + (getNonstaticOopMapSize()) * getHeap().getOopSize();
>    return alignObjectSize(headerSize + bodySize);
>    }
>
> This fix updates the SA code to be like the hotspot code. I've also
> introduced variables in the hotspot code and in the SA code to make it
> easier to compare the two versions.
>
> Webrev: http://cr.openjdk.java.net/~ehelin/8017588/webrev.00/
>
> Testing:
> - JPRT
> - Running jstack -l -F successfully on a java process using -XX:+UseConcMarkSweepGC
>
> Thanks,
> Erik



More information about the hotspot-runtime-dev mailing list