JDK-8178800 : compiler/c2/PolynomialRoot.java fails on Xeon Phi linux host with UseAVX=3
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-04-14
  • Updated: 2019-09-13
  • Resolved: 2017-05-16
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 JDK 9
10Fixed 9 b171Fixed
Related Reports
Relates :  
Description
compiler/c2/PolynomialRoot.java fails on Xeon Phi linux host with UseAVX=3

Output from the test:

----------System.err:(55/2425)----------
======== n=4
0	2.0	1.7071067811865475	0.7071067811865476
1	-4.0	0.2928932188134524	-0.7071067811865476
2	6.0	1.7071067811865475	-0.7071067811865476
3	-4.0	0.2928932188134524	0.7071067811865476
4	1.0	
======== n=4
0	0.0	0.6666666634803002	0.0
1	-4.0	-1.0000000000000002	0.0
2	8.0	0.6666666698530332	0.0
3	3.0	-4.163336342344337E-17	0.0
4	-9.0	
======== n=4
0	-1.0	1.0	0.0
1	0.0	-1.0	0.0
2	2.0	1.0	0.0
3	0.0	-1.0	0.0
4	-1.0	
======== n=4
0	-5.0	0.9999999770581592	0.0
1	2.0	-1.6666666666666674	0.0
2	8.0	1.0000000229418409	0.0
3	-2.0	-0.9999999999999993	0.0
4	-3.0	
======== n=3
0	0.0	-1.4142135623730951	0.0
1	-2.0	1.4142135623730951	0.0
2	0.0	-9.999199243478975E-17	0.0
3	1.0	
======== n=3
0	0.0	0.0	0.0
1	2.0	-0.0	-1.414213562373095
2	0.0	-0.0	1.414213562373095
3	1.0	
java.lang.RuntimeException: order=4	p[0]=0.4789637572207226;p[1]=0.0;p[2]=9.0;p[3]=0.0;p[4]=6.0;
	 x.r=0.0 x.i=0.48345773787630514
res/sabs=-0.026282681826419383 ims/sabs=0.0 sabs=49.34186511409237
res=-1.296836541515792 ims=0.0 n=4 eps=1.0E-6  sabs>1/eps=false f1=true f2=true  t=155
	at compiler.c2.PolynomialRoot.checkValues(PolynomialRoot.java:449)
	at compiler.c2.PolynomialRoot.testRoots(PolynomialRoot.java:507)
	at compiler.c2.PolynomialRoot.main(PolynomialRoot.java:781)
	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:547)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)

Comments
[~iignatyev] Igor, please look.
12-05-2017

Approved for JDK 9.
12-05-2017

Fix Request This bug needs to be fixed because it is a regression introduced in JDK 9 that causes incorrect execution of compiled code with default values on newer Intel processors supporting AVX-512. The fix only affects C2 on x86 and was tested with RBT and manually on newer hardware. http://cr.openjdk.java.net/~mcberg/8178800/webrev.02/ The fix was reviewed by kvn and thartmann.
12-05-2017

Actually, the fix request should be done by the author but I can do it as well.
12-05-2017

Need new testing for webrev.02. I reviewed them and agreed. [~thartmann] Tobias, please, add comment and label for JDK 9 approval process. Thanks!
11-05-2017

Current fix available at: http://cr.openjdk.java.net/~mcberg/8178800/webrev.02/
11-05-2017

Testing a fix for this issue now, webrev pending...
09-05-2017

Looking into KNL specific code generation.
02-05-2017

To reproduce this, one needs to specify the same seed for the random value generator: -bash-4.2$ JAVA_HOME=/tmp/tohartma/export/ /tmp/tohartma/jtreg/bin/jtreg -jdk:/tmp/tohartma/export -va -vmoptions:"" -javaoptions:"-Xcomp -XX:MaxRAMFraction=8 -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -XX:UseAVX=3 -Djdk.test.lib.random.seed=6251013599488180337" test/compiler/c2/PolynomialRoot.java [...] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: order=4 p[0]=0.31689365122005797;p[1]=0.0;p[2]=-6.0;p[3]=0.0;p[4]=3.0; x.r=0.8139439675393799 x.i=0.0 res/sabs=-0.17935433236746617 ims/sabs=0.0 sabs=13.054590050599106 res=-2.3413972828561693 ims=0.0 n=4 eps=1.0E-6 sabs>1/eps=false f1=true f2=true t=169
26-04-2017

In-progress
20-04-2017

Hi Michael, this looks like a problem with the AVX-512 implementation introduced by JDK-8076276. Could you please have a look? Let me know if you are unable to reproduce or don't have time to work on it. Thanks, Tobias
18-04-2017

ILW = Incorrect result of compiled method, on platforms supporting AVX-512 (where UseAVX=3 is default), use UseAVX < 3 = HMM = P2
18-04-2017