From owner-freebsd-java@FreeBSD.ORG Mon Oct 27 08:30:07 2008 Return-Path: Delivered-To: freebsd-java@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B291E1065674 for ; Mon, 27 Oct 2008 08:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6118FC08 for ; Mon, 27 Oct 2008 08:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9R8U7s2055599 for ; Mon, 27 Oct 2008 08:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9R8U7h9055596; Mon, 27 Oct 2008 08:30:07 GMT (envelope-from gnats) Resent-Date: Mon, 27 Oct 2008 08:30:07 GMT Resent-Message-Id: <200810270830.m9R8U7h9055596@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-java@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nikolay Denev Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 946C51065685 for ; Mon, 27 Oct 2008 08:26:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 836CB8FC1B for ; Mon, 27 Oct 2008 08:26:04 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9R8Q4VS037574 for ; Mon, 27 Oct 2008 08:26:04 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m9R8Q4Rf037573; Mon, 27 Oct 2008 08:26:04 GMT (envelope-from nobody) Message-Id: <200810270826.m9R8Q4Rf037573@www.freebsd.org> Date: Mon, 27 Oct 2008 08:26:04 GMT From: Nikolay Denev To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: java/128411: jdk1.5 Querying JMX mbean OperatingSystem->TotalPhysicalMemorySize crashes the VM on 64bit archs. 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, 27 Oct 2008 08:30:07 -0000 >Number: 128411 >Category: java >Synopsis: jdk1.5 Querying JMX mbean OperatingSystem->TotalPhysicalMemorySize crashes the VM on 64bit archs. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-java >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 27 08:30:06 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Nikolay Denev >Release: 7.1-PRERELEASE >Organization: >Environment: FreeBSD XXX 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #1: Wed Oct 22 15:35:49 UTC 2008 root@XXX:/usr/obj/usr/src/sys/CORE2 amd64 >Description: The FreeBSD specific part of the OperationgSystem mbean uses sysctl(3) to query various parameters related to memory usage. The sysctl(3) call requires an argument of type 'size_t' to set the size of the reqested value but in one place the bsd-jdk15-patchset uses variable of type 'int' for this, which does not work correctly because int is 32bits and size_t is 64bits on 64bit archs. Querying this attribute (TotalPhysicalMemorySize) results in VM crash. >How-To-Repeat: Start an application with remote JMX enabled and connect to it with jconsole. >Fix: The attached patch to the bsd-jdk15-patchset8 fixes the problem. Patch attached with submission follows: --- jdk15.patches 2008-02-05 07:01:27.000000000 +0200 +++ jdk15.patches.fixed 2008-10-24 11:58:53.000000000 +0300 @@ -90835,7 +90835,7 @@ +#ifdef _ALLBSD_SOURCE + unsigned long result; + int mib[2]; -+ int rlen; ++ size_t rlen; + + mib[0] = CTL_HW; + mib[1] = HW_PHYSMEM; >Release-Note: >Audit-Trail: >Unformatted: