JDK-8188835 : AllocateUninitializedArray fails with "IllegalStateException: Wrong class: expected = class [I, but got class [C "
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 10
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-10-05
  • Updated: 2020-09-01
  • Resolved: 2017-10-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Duplicate :  
Relates :  
Description
compiler/intrinsics/unsafe/AllocateUninitializedArray.java failed on solaris_x64 running the last action 'run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 compiler.intrinsics.unsafe.AllocateUninitializedArray' 

ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.IllegalStateException: Wrong class: expected = class [I, but got class [C
REASON: User specified action: run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 compiler.intrinsics.unsafe.AllocateUninitializedArray 
TIME:   7.948 seconds
messages:
command: main -ea -Diters=30000 -XX:TieredStopAtLevel=4 compiler.intrinsics.unsafe.AllocateUninitializedArray
reason: User specified action: run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 compiler.intrinsics.unsafe.AllocateUninitializedArray 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
elapsed time (seconds): 7.948
configuration:
Boot Layer
  add modules: java.base                   
  add exports: java.base/jdk.internal.misc ALL-UNNAMED
  add opens:   java.base/jdk.internal.misc ALL-UNNAMED

STDOUT:
STDERR:
java.lang.IllegalStateException: Wrong class: expected = class [I, but got class [C
	at compiler.intrinsics.unsafe.AllocateUninitializedArray.testOK(AllocateUninitializedArray.java:116)
	at compiler.intrinsics.unsafe.AllocateUninitializedArray.main(AllocateUninitializedArray.java:78)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)
Comments
I've executed over 1000 runs on a Solaris x64 machine with the same build but I was not able to reproduce the problem. I'm not able to access the JPRT machine where this failure originally happened. I was also not able to find other instances of this problem. I'm closing this as "Cannot reproduce". Please re-open if it shows up again on an accessible machine.
09-10-2017

If it's in tier-1, shouldn't priority be P1?
06-10-2017

ILW = Test fails due to wrong type of array created via Unsafe, single test on hs-tier-1 but highly intermittent, no workaround = HLH = P2
06-10-2017

the failure seems to be highly intermittent.
05-10-2017

attached AllocateUninitializedArray.jtr
05-10-2017