Bug#516267: gcj-4.3: number of processors reported by Runtime.getRuntime().availableProcessors() is incorrect
Package: gcj-4.3
Version: 4.3.2-2
Severity: normal
A java-program compiled using gcj returns different output for Runtime.getRuntime().availableProcessors() compared to one ran via the sun java jre.
folkert@belle:~/pos/work$ gcj --version
gcj (Debian 4.3.2-2) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
folkert@belle:~/pos/work$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
folkert@belle:~/pos/work$ javac numprocs.java
folkert@belle:~/pos/work$ java numprocs
number of processors: 4
folkert@belle:~/pos/work$ gcj --main=numprocs -o numprocs numprocs.java
folkert@belle:~/pos/work$ ./numprocs
number of processors: 1
folkert@belle:~/pos/work$ grep Q9450 /proc/cpuinfo
model name : Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz
model name : Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz
model name : Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz
model name : Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz
folkert@belle:~/pos/work$ cat numprocs.java
class numprocs
{
public static void main(String [] args)
{
System.out.println("number of processors: " + Runtime.getRuntime().availableProcessors());
}
}
-- System Information:
Debian Release: 5.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-pps (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages gcj-4.3 depends on:
ii gcc-4.3 4.3.2-1 The GNU C compiler
ii gcj-4.3-base 4.3.2-2 The GNU Compiler Collection (gcj b
ii gij-4.3 4.3.2-2 The GNU Java bytecode interpreter
ii java-common 0.30 Base of all Java packages
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libc6-dev 2.7-16 GNU C Library: Development Librari
ii libecj-java 3.3.0+0728-9 Eclipse Java compiler (library)
ii libgcc1 1:4.3.2-1 GCC support library
ii libgcj-bc 4.3.2-2 Link time only library for use wit
ii libgcj9-0 4.3.2-2 Java runtime library for use with
ii libgcj9-dev 4.3.2-2 Java development headers for use w
ii libgcj9-jar 4.3.2-2 Java runtime library for use with
ii libgmp3c2 2:4.2.2+dfsg-3 Multiprecision arithmetic library
ii libmpfr1ldbl 2.3.1.dfsg.1-2 multiple precision floating-point
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
Versions of packages gcj-4.3 recommends:
pn fastjar <none> (no description available)
pn libecj-java-gcj <none> (no description available)
Versions of packages gcj-4.3 suggests:
pn java-gcj-compat-dev <none> (no description available)
pn libgcj9-dbg <none> (no description available)
-- no debconf information
Reply to: