Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 08:26:04 GMT
From:      Nikolay Denev <ndenev@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   java/128411: jdk1.5 Querying JMX mbean OperatingSystem->TotalPhysicalMemorySize crashes the VM on 64bit archs.
Message-ID:  <200810270826.m9R8Q4Rf037573@www.freebsd.org>
Resent-Message-ID: <200810270830.m9R8U7h9055596@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810270826.m9R8Q4Rf037573>