From owner-freebsd-java@FreeBSD.ORG Mon Apr 16 20:08:33 2012 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1923F1065670; Mon, 16 Apr 2012 20:08:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-java@freebsd.org Date: Mon, 16 Apr 2012 16:08:18 -0400 User-Agent: KMail/1.6.2 References: <20120416162239.GA59319@misty.eyesbeyond.com> In-Reply-To: <20120416162239.GA59319@misty.eyesbeyond.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204161608.21463.jkim@FreeBSD.org> Cc: Andrew Subject: Re: OpenJDK7 jmap UnalignedAddressException X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 20:08:33 -0000 On Monday 16 April 2012 12:22 pm, Greg Lewis wrote: > G'day Andrew, > > On Sun, Apr 15, 2012 at 03:17:42PM +0100, Andrew wrote: > > I'm running a 9-STABLE on AMD64 machine with the port > > java/openjdk7 installed and when I execute jmap against a running > > java process of the same JDK running under the same (non-root) > > user or running jmap as root I get the following exception: > > > > Attaching to process ID 97337, please wait... > > Exception in thread "main" > > java.lang.reflect.InvocationTargetException at > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI > >mpl.java:57) at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA > >ccessorImpl.java:43) at > > java.lang.reflect.Method.invoke(Method.java:601) 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: > > 746f705b75af4867 at > > sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1.checkAlignment(Bs > >dDebuggerLocal.java:181) at > > sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readCInteger(BsdDeb > >uggerLocal.java:478) at > > sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBa > >se.java:454) at > > sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.readAddress(BsdDebu > >ggerLocal.java:423) at > > sun.jvm.hotspot.debugger.bsd.BsdAddress.getAddressAt(BsdAddress.j > >ava:74) at > > sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBa > >se.java:154) at > > sun.jvm.hotspot.HotSpotTypeDataBase.(HotSpotTypeDataBase.ja > >va:85) at > > sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:57 > >2) at > > sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:493) at > > sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:331 > >) at sun.jvm.hotspot.tools.Tool.start(Tool.java:163) at > > sun.jvm.hotspot.tools.PMap.main(PMap.java:67) ... 6 more > > > > uname: FreeBSD 9.0-STABLE #0: Thu Apr 12 10:59:45 BST 2012 > > Java: > > /usr/local/openjdk7/bin/java -version > > openjdk version "1.7.0_02" > > OpenJDK Runtime Environment (build 1.7.0_02-b13) > > OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode) > > > > Has anyone else seen this error? > > At some point during the OpenJDK 7 lifespan this and other related > utilities seem to have stopped working. I fixed (similar) problems on OpenJDK6 long ago. Please see openjdk6 b21 and b21_1 patchsets and commit log. > I haven't really sat down and looked into what broke yet. Might be > interesting to see if i386 gets the same error as amd64. I guess you are thinking thread pointer <-> int conversions are the culprits. If so, you need FreeBSD-specific hacks as I did for OpenJDK6. Jung-uk Kim