From owner-freebsd-java@FreeBSD.ORG Wed Mar 25 23:02:40 2015 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FDF2361 for ; Wed, 25 Mar 2015 23:02:40 +0000 (UTC) Received: from mail-oi0-x22a.google.com (mail-oi0-x22a.google.com [IPv6:2607:f8b0:4003:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03C23FF4 for ; Wed, 25 Mar 2015 23:02:40 +0000 (UTC) Received: by oiag65 with SMTP id g65so35058724oia.2 for ; Wed, 25 Mar 2015 16:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=z49NG44QWRODnZQu0dt0t3OSbc3995xVUpBnBcFSLlc=; b=QnnuHMQI16dRJAlIwnr+Fs3PTFq0E2VJb6eyLLW4wa9mo8uP4EwVaaJg3lULVXStGB j0qHEWPQetHFggkoJ2PPtC2H+5xh2mrtSBZOyxrpYuhboRz3Bn0eRN6Yr8mqcVwyW02q 6/gJqbur1CRgqINEYsuJbsIpChZoyMQe31gDEPmnqyq9y9Gw1YRzpUSM1MBYT2aWkW1L 4qvn6OYFJlM8Fl0/SpGa3BVIOf+Zd5AbJDNn6lRnEUJBqcyz4YZrbSzOWvJw0ta7Y3h8 F1fKheNU3tHmrCGufihpuNOWHlWtkA4fPzDrTD1lRkaPTm4GszlsjtrlLOu8xoM7RR8d bPnw== MIME-Version: 1.0 X-Received: by 10.182.120.3 with SMTP id ky3mr9506196obb.33.1427324559342; Wed, 25 Mar 2015 16:02:39 -0700 (PDT) Received: by 10.202.48.195 with HTTP; Wed, 25 Mar 2015 16:02:39 -0700 (PDT) Date: Thu, 26 Mar 2015 00:02:39 +0100 Message-ID: Subject: dtrace, jstack and lang/openjdk7 or 8 From: Johannes Dieterich To: freebsd-java@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 23:02:40 -0000 Hi, I am currently trying to get dtrace to work with either java/openjdk7 or java/openjdk8 (as per Brendan Gregg's howto: http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html). Unfortunately, I get exactly what he describes: I am missing everything inside the JVM. I suspect this has to do with jstack() not working. The bundled jstack executable (yes, I know that they are only vaguely related) also seems to work only so-so. Basically, I can get a working stack trace without a variable, with -l, but not with -m, and not with -F. It causes exceptions like this: $ /usr/local/openjdk7/bin/jstack -m 84749 Attaching to process ID 84749, 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.jstack.JStack.runJStackTool(JStack.java:136) at sun.tools.jstack.JStack.main(JStack.java:102) Caused by: sun.jvm.hotspot.debugger.UnalignedAddressException: 746f705b762f4867 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.(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.JStack.main(JStack.java:86) ... 6 more So, what I am asking is: anybody out there got a working setup for dtrace+openjdk on FreeBSD? If so, it would be fantastic if you could post the necessary steps! Thanks a lot! Johannes