FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b24)
Java HotSpot(TM) Client VM (build 12.0-b01, mixed mode, sharing)
FULL OS VERSION :
Microsoft Windows [Version 6.0.6000]
A DESCRIPTION OF THE PROBLEM :
Unfortunately, I cannot send the simple test illustrating a bug. Obviously, the bug arises only in a complex code, for example, in our application.
Below is the link to 1MB jar-file, containing our libraries and tests:
Please download this jar and run the following test (maybe, with another path to java.exe):
"C:\Program Files (x86)\Java\jdk1.7.0\jre\bin\java" -ea -server -cp algorithm-lib-plus-demo.jar -Xmx200m -Dnet.algart.arrays.globalMemoryModel=BUFFER net.algart.arrays.demo.MainOperationsTest boolean 1000 1000 1 1 5
This test checks our complex algorithmic procedures, containing intensive manipulations with bits, packed into LongBuffer (1000 bits packed into 16 LongBuffer elements, 1000 passes). The sequence of operations is random, but the initial randseed is set via the 5th argument of this test (1), so every call leads to the same results.
When called by 32-bit java 1.7.0-ea-b24, this test prints an error message:
(5) Testing "buffer().map" method, changing + forcing...
java.lang.AssertionError: The bug in setData found in test #455: destPos = 21, count = 887, error found at 928
at net.algart.arrays.demo.MainOperationsTest.testBufferMapping(Unknown Source)
at net.algart.arrays.demo.MainOperationsTest.testElementType(Unknown Source)
at net.algart.arrays.demo.MainOperationsTest.testAll(Unknown Source)
at net.algart.arrays.demo.MainOperationsTest.main(Unknown Source)
(This message should inform about a bug in our setData method.)
However, if we call this test without "-server" key or with "-Xint" key, or under 64-bit version of java 1.7.0-ea-b24, or under java 1.6.0_02, the test works normally and do not find any errors.
But: 32-bit java 1.6.0_04 (with -server key) also cannot perform this test!
I detected analogous bugs with bit manipulations under previous releases of Java 1.7.0-ea, on Windows XP SP2. The thorough investigations shew that sometimes 1 bit in a long bit array (packed into a direct LongBuffer) is processed incorrectly. It is probably a new bug, appeared in JVM while your latest optimizations.
If you need, we may send you the source files, but they are large and complex enough.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please download our JAR and run the test listed above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: identical behaviour (excepting the speed) under all versions of JVM and regardless of "-server" or "-Xint" keys
Actual: under 32-bit versions of java 1.7.0-ea-b24 and java 1.6.0_04-b12, with -server key, this test "detects a bug" in my algorithms, really, I think - in the HotSpot optimizer.
This bug can be reproduced always.