Bug 193475 - java/openjdk7 jinfo and jmap do not work
Summary: java/openjdk7 jinfo and jmap do not work
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-09 03:26 UTC by Jov
Modified: 2019-05-01 12:09 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jov 2014-09-09 03:26:40 UTC
java -version
openjdk version "1.7.0_60"
OpenJDK Runtime Environment (build 1.7.0_60-b19)
OpenJDK 64-Bit Server VM (build 24.60-b09, mixed mode)

uname -a
FreeBSD xx 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul  8 06:37:44 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

[work@xx ~]$ jmap -heap 23650
Attaching to process ID 23650, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at sun.tools.jmap.JMap.runTool(JMap.java:197)
	at sun.tools.jmap.JMap.main(JMap.java:128)
Caused by: sun.jvm.hotspot.debugger.UnalignedAddressException: 746f705b75ef4867
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1.checkAlignment(BsdDebuggerLocal.java:183)
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readCInteger(BsdDebuggerLocal.java:485)
	at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readAddress(BsdDebuggerLocal.java:430)
	at sun.jvm.hotspot.debugger.bsd.BsdAddress.getAddressAt(BsdAddress.java:74)
	at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:154)
	at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:85)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:573)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
	at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
	at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:40)
	... 6 more
[work ~]$ jinfo 23650
Attaching to process ID 23650, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at sun.tools.jinfo.JInfo.runTool(JInfo.java:97)
	at sun.tools.jinfo.JInfo.main(JInfo.java:71)
Caused by: sun.jvm.hotspot.debugger.UnalignedAddressException: 746f705b75ef4867
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1.checkAlignment(BsdDebuggerLocal.java:183)
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readCInteger(BsdDebuggerLocal.java:485)
	at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
	at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readAddress(BsdDebuggerLocal.java:430)
	at sun.jvm.hotspot.debugger.bsd.BsdAddress.getAddressAt(BsdAddress.java:74)
	at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:154)
	at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:85)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:573)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
	at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
	at sun.jvm.hotspot.tools.JInfo.main(JInfo.java:128)
	... 6 more
Comment 1 John Marino freebsd_committer 2014-09-12 06:35:42 UTC
notify maintainer
Comment 2 Jung-uk Kim freebsd_committer 2014-09-12 15:58:04 UTC
Assign to the actual maintainer.  Add java@FreeBSD.org to CC list.
Comment 3 Dmitry Samersoff 2014-09-12 18:16:39 UTC
Both jmap and jinfo uses serviceability agent, see hotspot/agent for the sources
Comment 4 Jung-uk Kim freebsd_committer 2014-09-12 18:28:44 UTC
(In reply to Dmitry Samersoff from comment #3)
> Both jmap and jinfo uses serviceability agent, see hotspot/agent for the
> sources

Yes, I fixed the problems for java/openjdk6 long ago.

http://svnweb.freebsd.org/changeset/ports/268830

I ported the fixes to java/openjdk8, too.  Unfortunately, I never found time to fix them for java/openjdk7.
Comment 5 Jung-uk Kim freebsd_committer 2014-09-12 18:34:25 UTC
(In reply to Jung-uk Kim from comment #4)
> I ported the fixes to java/openjdk8, too.

Actually, now I am not sure about this any more.  I'll test it later.
Comment 6 Jung-uk Kim freebsd_committer 2014-09-17 22:06:30 UTC
It seems we haven't merged this changeset for BSD:

http://hg.openjdk.java.net/bsd-port/bsd-port/hotspot/rev/c7b481c7e5d9
Comment 7 Jung-uk Kim freebsd_committer 2014-09-18 20:51:24 UTC
(In reply to Jung-uk Kim from comment #5)
> (In reply to Jung-uk Kim from comment #4)
> > I ported the fixes to java/openjdk8, too.
> 
> Actually, now I am not sure about this any more.  I'll test it later.

I just tested java/openjdk8.  It seems it does not have this problem.
Comment 8 Jung-uk Kim freebsd_committer 2014-09-18 20:52:41 UTC
(In reply to Jung-uk Kim from comment #6)
> It seems we haven't merged this changeset for BSD:
> 
> http://hg.openjdk.java.net/bsd-port/bsd-port/hotspot/rev/c7b481c7e5d9

I guess I was wrong.  It still seems to fail with this change merged to a BSD version.
Comment 9 Palle Girgensohn freebsd_committer 2016-08-22 17:44:50 UTC
So does jmap work for OpenJDK8?
Comment 10 Jov 2017-05-09 11:05:37 UTC
(In reply to Palle Girgensohn from comment #9)
not work for openjdk8:

Attaching to process ID 51833, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.tools.jmap.JMap.runTool(JMap.java:201)
	at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: java.lang.InternalError: void* type hasn't been seen when parsing int*
	at sun.jvm.hotspot.HotSpotTypeDataBase.recursiveCreateBasicPointerType(HotSpotTypeDataBase.java:721)
	at sun.jvm.hotspot.HotSpotTypeDataBase.lookupType(HotSpotTypeDataBase.java:134)
	at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrCreateClass(HotSpotTypeDataBase.java:631)
	at sun.jvm.hotspot.HotSpotTypeDataBase.createType(HotSpotTypeDataBase.java:751)
	at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:195)
	at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:89)
	at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:400)
	at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:306)
	at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:141)
	at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
	at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
	at sun.jvm.hotspot.tools.PMap.main(PMap.java:72)
	... 6 more
Comment 11 Walter Schwarzenfeld freebsd_triage 2018-02-03 02:04:42 UTC
Any news here?
Comment 12 Michael Osipov 2018-08-03 19:52:09 UTC
I can confirm this for 1.7:

> $ sudo JAVA_VERSION=1.7 jmap -heap 61192
> Attaching to process ID 61192, please wait...
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at sun.tools.jmap.JMap.runTool(JMap.java:197)
>         at sun.tools.jmap.JMap.main(JMap.java:128)
> Caused by: sun.jvm.hotspot.debugger.UnalignedAddressException: 9cef4867
>         at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1.checkAlignment(BsdDebuggerLocal.java:183)
>         at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readCInteger(BsdDebuggerLocal.java:487)
>         at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:454)
>         at sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readAddress(BsdDebuggerLocal.java:430)
>         at sun.jvm.hotspot.debugger.bsd.BsdAddress.getAddressAt(BsdAddress.java:74)
>         at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:154)
>         at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:85)
>         at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:573)
>         at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
>         at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
>         at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
>         at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:40)
>         ... 6 more

OpenJDK 8 works like a charm.
Comment 13 Steve Wills freebsd_committer 2019-05-01 12:09:44 UTC
For me, testing on openjdk8 on CURRENT, jmap works fine, but jinfo says:

Java System Properties:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.tools.jinfo.JInfo.runTool(JInfo.java:108)
        at sun.tools.jinfo.JInfo.main(JInfo.java:76)
Caused by: java.lang.InternalError: Metadata does not appear to be polymorphic
        at sun.jvm.hotspot.types.basic.BasicTypeDataBase.findDynamicTypeForAddress(BasicTypeDataBase.java:278)
        at sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:102)
        at sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:68)
        at sun.jvm.hotspot.memory.SystemDictionary.getSystemKlass(SystemDictionary.java:127)
        at sun.jvm.hotspot.runtime.VM.readSystemProperties(VM.java:879)
        at sun.jvm.hotspot.runtime.VM.getSystemProperties(VM.java:873)
        at sun.jvm.hotspot.tools.SysPropsDumper.run(SysPropsDumper.java:44)
        at sun.jvm.hotspot.tools.JInfo$1.run(JInfo.java:79)
        at sun.jvm.hotspot.tools.JInfo.run(JInfo.java:94)
        at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.JInfo.main(JInfo.java:138)
        ... 6 more