>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
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Oct 27 08:30:06 UTC 2008
>Originator: Nikolay Denev
>Release: 7.1-PRERELEASE

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

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.

Start an application with remote JMX enabled and connect to it with jconsole.

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 @@
+ unsigned long result;
+ int mib[2];
-+ int rlen;
++ size_t rlen;
+ mib[0] = CTL_HW;
+ mib[1] = HW_PHYSMEM;


freebsd-java@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"