RFR: JDK-8163272: jhsdb jinfo cannot show system properties
David Holmes
david.holmes at oracle.com
Mon Aug 8 00:59:50 UTC 2016
On 8/08/2016 10:26 AM, Yasumasa Suenaga wrote:
> Hi David,
>
> To get properties from memory, SA have to know memory layout.
> SA is used for attaching to live process/core image. So we cannot
> execute Java API.
I see - so we have to read memory element by memory element.
Okay - code seems okay.
Thanks,
David
> Thanks,
>
> Yasumasa
>
>
> 2016/08/08 8:52 "David Holmes" <david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>>:
>
> Hi Yasumasa,
>
> On 5/08/2016 9:59 PM, Yasumasa Suenaga wrote:
>
> Hi all,
>
> I tried to get system properties via "jhsdb jinfo".
> However, it did not work as below:
>
> ----------------
> $ /usr/local/jdk-9/bin/jhsdb jinfo --pid 1002
> Attaching to process ID 1002, please wait...
> Debugger attached successfully.
> Server compiler detected.
> JVM version is 9-ea+129
> Java System Properties:
>
> java.lang.NullPointerException
> at
> sun.jvm.hotspot.utilities.ObjectReader.getHashtable(jdk.hotspot.agent at 9-ea/ObjectReader.java:217)
>
> at
> sun.jvm.hotspot.utilities.ObjectReader.readInstance(jdk.hotspot.agent at 9-ea/ObjectReader.java:247)
>
> at
> sun.jvm.hotspot.utilities.ObjectReader.readObject(jdk.hotspot.agent at 9-ea/ObjectReader.java:105)
>
> at
> sun.jvm.hotspot.runtime.VM$2.doOop(jdk.hotspot.agent at 9-ea/VM.java:940)
> at
> sun.jvm.hotspot.oops.InstanceKlass.visitField(jdk.hotspot.agent at 9-ea/InstanceKlass.java:872)
>
> at
> sun.jvm.hotspot.oops.InstanceKlass.iterateStaticFieldsInternal(jdk.hotspot.agent at 9-ea/InstanceKlass.java:572)
>
> at
> sun.jvm.hotspot.oops.InstanceKlass.iterateStaticFields(jdk.hotspot.agent at 9-ea/InstanceKlass.java:560)
>
> at
> sun.jvm.hotspot.runtime.VM.readSystemProperties(jdk.hotspot.agent at 9-ea/VM.java:935)
>
> :
> System Properties info not available!
> ----------------
> * If you want to see all stack, please see JBS.
>
>
> I think this is caused by JDK-8029891.
> JDK-8029891 changes that j.u.Properties stores properties to
> j.u.c.ConcurrentHashMap.
> ObjectReader should be adapted to this change.
>
> I uploaded webrev. Could you review it?
>
> http://cr.openjdk.java.net/~ysuenaga/JDK-8163272/webrev.00/
> <http://cr.openjdk.java.net/~ysuenaga/JDK-8163272/webrev.00/>
>
>
> I'm not very familiar with how SA operates here so this could be a
> stupid question, but why do we need to know exactly how Properties
> are implemented instead of just using the public API to access them
> and read/write them ??
>
> Thanks,
> David
>
> I'm jdk 9 commiter, but I cannot access JPRT.
> So I need a sponsor.
>
>
> Thanks,
>
> Yasumasa
>
>
More information about the serviceability-dev
mailing list