From owner-freebsd-emulation@freebsd.org Fri Aug 5 07:48:55 2016 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB74BAF378 for ; Fri, 5 Aug 2016 07:48:55 +0000 (UTC) (envelope-from chunlinyao@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 C63361FCB for ; Fri, 5 Aug 2016 07:48:54 +0000 (UTC) (envelope-from chunlinyao@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id i6so19736205pfe.0 for ; Fri, 05 Aug 2016 00:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=a5mOcOcf3D2cZiFBDNTxEaJbyyE8ezKscv3QyQyzRh4=; b=QAfkTqKI8PftCQlm0UhyPZIZHiBX6wm+QysA5gpfVgHgFcyVTDGN5gqoFHyr92fYLi +G/4DmiocL0AM8/rlZH/iClRO5CwGUAvvjfN54sCpcZgGmQ10iW6Ue2FadSfCq2lTkn8 cPs4rGF4sZpHcuhVXLFnzsB2qkhfHr0G2FSaA5f7n3deCNm5688CgaJ1QWsWeIh4VMfi uVDLNMw0l0hAkpNHB+Nf/zjyLd4KpT/hPElpdvazRahU0p+T/EIUK8nbp8YGb8WHhhNW SZnPd+ibTX6geoL6Yam5QB7+ifX83G+t79/2q0z0rGQPYLUOSRqwbEqSH5parem4j8ih ZYZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=a5mOcOcf3D2cZiFBDNTxEaJbyyE8ezKscv3QyQyzRh4=; b=ZGaMW5ZW2YJ5DUrabZUftOxv8OzCPocbyTT4XYFvVWoOMmps+WNdNNJFCgBWt9MxOp b7UGcJzkr70XccRoZkqaqz0T+nVKbt8wK0r4qdhJle6ZLcNolsQb55pHemNRx5L7SbKP AFx6ithu53RGYY5opplRc7+3zsMZ2IRV+a5nSXJ+OL6lwivcGlfUdAngNpI9PTEQMqjr XGYxeXqYObj7Olwa3v3+Rsuqchvx+KE30h9W7mDlt/ESIIICgfXKZJuSTHR1API2Sq5J DoOdBbvhL9YKlDz5t8uNqee22AX8KOfHosLlaCgpNQW/ZufuMNAwSuxXuWmsHovz/boY k9Tw== X-Gm-Message-State: AEkoouuCuEjBDI5kBZ1bcswY2R8MT6ol59ESgWQ0oaD9bN/dB/IhVxSpCGwlHL32ZYf6xA== X-Received: by 10.98.34.66 with SMTP id i63mr132726578pfi.130.1470383334057; Fri, 05 Aug 2016 00:48:54 -0700 (PDT) Received: from [172.28.1.168] (KD113154025018.ppp-bb.dion.ne.jp. [113.154.25.18]) by smtp.gmail.com with ESMTPSA id lf11sm25559317pab.17.2016.08.05.00.48.51 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Aug 2016 00:48:52 -0700 (PDT) From: YaoCL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: jstack can not attach to jvm under linux emulation Message-Id: Date: Fri, 5 Aug 2016 15:48:46 +0800 To: freebsd-emulation@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 07:48:55 -0000 Hi I am runing a java web application under FreeBSD 10.3, Because some = reason we must use the Oracle JDK. It all work fine. Even the Java = Flight Recorder works fine. I have a monitor tools require to dynamic attach to the JVM. the attach = can not work. # /usr/local/linux-oracle-jdk1.8.0/bin/jstack 20105 Exception in thread "main" java.io.IOException: Broken pipe at sun.tools.attach.LinuxVirtualMachine.write(Native Method) at = sun.tools.attach.LinuxVirtualMachine.writeString(LinuxVirtualMachine.java:= 311) at = sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:178)= at = sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachin= e.java:261) at = sun.tools.attach.HotSpotVirtualMachine.remoteDataDump(HotSpotVirtualMachin= e.java:218) at sun.tools.jstack.JStack.runThreadDump(JStack.java:181) at sun.tools.jstack.JStack.main(JStack.java:116) The unix domain socket (.java_pid20105) created in /tmp folder, but when = jstack write to it, It got an error. I also tried use netcat to connect the unix socket, It also closed = immediately. truss show some message like this =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D linux_clock_gettime(0x1,0x290cb958) =3D 0 (0x0) linux_stat64("/tmp/.java_pid20105",0x290cbc7c,0x290cbc7c) =3D 0 (0x0) geteuid() =3D 0 (0x0) getegid() =3D 0 (0x0) linux_stat64("/tmp/.java_pid20105",0x290cbd18,0x290cbd18) =3D 0 (0x0) linux_socketcall(1,{ LINUX_SOCKET, 0x0 }) =3D 6 (0x6) linux_socketcall(3,{ LINUX_GETSOCKNAME, 0x6e }) =3D 0 (0x0) close(6) =3D 0 (0x0) linux_clock_gettime(0x1,0x290cba3c) =3D 0 (0x0) linux_clock_gettime(0x1,0x290cb9f8) =3D 0 (0x0) linux_socketcall(1,{ LINUX_SOCKET, 0x0 }) =3D 6 (0x6) linux_socketcall(3,{ LINUX_GETSOCKNAME, 0x6e }) =3D 0 (0x0) linux_clock_gettime(0x1,0x290cb630) =3D 0 (0x0) write(6,"1",1) ERR#32 'Broken pipe' SIGNAL 13 (SIGPIPE) linux_rt_sigreturn(0x290cbc18) ERR#32 'Broken pipe' linux_open("/usr/share/locale/locale.alias",0x0,0666) =3D 7 (0x7) linux_fstat64(0x7,0x290cb580) =3D 0 (0x0) linux_mmap2(0x0,0x1000,0x3,0x22,0xffffffff,0x0) =3D 671535104 = (0x2806d000) read(7,"# Locale name alias data base.\n"...,4096) =3D 2512 (0x9d0) linux_clock_gettime(0x1,0x7c39e120) =3D 0 (0x0) read(7,0x2806d000,4096) =3D 0 (0x0) close(7) =3D 0 (0x0) munmap(0x2806d000,4096) =3D 0 (0x0) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D My FreeBSD version : 10.3-RELEASE-p6 idk version: linux-oracle-jdk18-8.73 linux base: linux_base-c6-6.7_1 =E2=80=94 YaoCL=