United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6932536 JSR 292 modified JDK MethodHandlesTest fails on x86_64
6932536 : JSR 292 modified JDK MethodHandlesTest fails on x86_64

Details
Type:
Bug
Submit Date:
2010-03-05
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs18
Fixed Versions:
hs18

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Changing the nextArg value of MethodHandlesTest to be bigger than Integer.MAX_VALUE to actually test long arguments reveals a bug on x86_64:

$ /java/re/jdk/7/promoted/latest/binaries/solaris-x64/bin/amd64/java -showversion -Xint -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -classpath /java/devtools/share/junit/latest/junit.jar:. org.junit.runner.JUnitCore MethodHandlesTest
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b85)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b10, interpreted mode)

JUnit version 4.4
Java HotSpot(TM) 64-Bit Server VM warning: JSR 292 invokedynamic is disabled in this JVM.  Use -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic to enable.
.IIIIII.assertCalled s3:
expected:   [s3, [1000000000003]]
actual:     [s3, [-2749506449405]]
ex. types:  [s3, [Long]]
act. types: [s3, [Long]]
E....I......Segmentation Fault

                                    

Comments
EVALUATION

ChangeSet=http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/51db1e4b379d,ChangeRequest=6932536
                                     
2010-03-08
EVALUATION

There were actually two bugs:

1. For i2l and unboxi long values were stored in two slots as 32-bit words instead of a 64-bit one.

2. The stack-move conversion value was read as 32-bit value and then shifted which resulted in e.g. 0xffffffff values in 64-bit registers instead of -1.
                                     
2010-03-05



Hardware and Software, Engineered to Work Together