背景:SPEjvm2008包含一个版本的Javac作为基准测试。重要的是要使用相同版本的Javac,因此在基准测试运行的开始包含一个版本检查。
问题描述:运行SPECjvm2008,如“java -Xms1024m -Xmx173450m -jar SPECjvm2008.jar -ikv -peak -Dspecjvm.benchmark.threads=64”。“jar”将导致检查测试失败。
报错信息:
SPECjvm2008 Peak
Properties file: none
Benchmarks: startup.helloworld startup.compiler.compiler startup.compiler.sunflow startup.compress startup.crypto.aes startup.crypto.rsa startup.crypto.signverify startup.mpegaudio startup.scimark.fft startup.scimark.lu startup.scimark.monte_carlo startup.scimark.sor startup.scimark.sparse startup.serial startup.sunflow startup.xml.transform startup.xml.validation compiler.compiler compiler.sunflow compress crypto.aes crypto.rsa crypto.signverify derby mpegaudio scimark.fft.large scimark.lu.large scimark.sor.large scimark.sparse.large scimark.fft.small scimark.lu.small scimark.sor.small scimark.sparse.small scimark.monte_carlo serial sunflow xml.transform xml.validation
WARNING: Run will not be compliant.
Property specjvm.run.checksum.validation must be true for publication.
--- --- --- --- --- --- --- --- ---
Benchmark: check
Run mode: static run
Test type: functional
Threads: 1
Iterations: 1
Run length: 1 operation
Iteration 1 (1 operation) begins: Wed Sep 09 19:54:56 CST 2020
Iteration 1 (1 operation) ends: Wed Sep 09 19:54:56 CST 2020
Iteration 1 (1 operation) result: FAILED
Errors in benchmark: check
[iter=1] Interrupted when joining benchmark thread 0: null
[iter=1] java.lang.InterruptedException: null
java.base/java.lang.Object.wait(Native Method)
java.base/java.lang.Thread.join(Thread.java:1305)
java.base/java.lang.Thread.join(Thread.java:1379)
spec.harness.ProgramRunner.runIteration(ProgramRunner.java:504)
spec.harness.ProgramRunner.runBenchmark(ProgramRunner.java:348)
spec.harness.ProgramRunner.run(ProgramRunner.java:98)
[iter=1] Iteration failed.
[iter=1][bt:1|op:1] Validation failure on line 9.
Expected output:
[008] 2nd bounds test: OK
[009] testIf: OK
[010] testArray: OK
[011] testBitOps: OK
[012] testFor: OK
[013] testDiv: OK
[014] ...
Received output:
[008] 2nd bounds test: OK
[009] Compiler version test: failed
[010] testIf: OK
[011] testArray: OK
[012] testBitOps: OK
[013] testFor: OK
[014] ...
Complete output: /SPECjvm2008/results/SPECjvm2008.007/check.bt1.i1.op1.error.log
Validation file: /SPECjvm2008/resources/check/validity.check.dat
No benchmarks will be run, since initial check test failed.
The Javac version test in check failed.
The Javac version must be the one included in SPECjvm2008.
There is a known issue with this for Java on Mac OS X, including a workaround.
For more info, see ./docs/KnownIssues.html
Results are stored in:
/SPECjvm2008/results/SPECjvm2008.007/SPECjvm2008.007.raw
Generating reports in:
/SPECjvm2008/results/SPECjvm2008.007
Composite result: 1
--- --- --- --- --- --- --- --- ---
WARNING! Known issue detected:
The Javac version test in check failed.
The Javac version must be the one included in SPECjvm2008.
There is a known issue with this for Java on Mac OS X, including a workaround.
For more info, see ./docs/KnownIssues.html
报错分析:重要错误信息:“ [009] Compiler version test: failed”。SPECjvm2008中包含了一个javac版本,由于编译器基准测试使用了它,所以检查基准测试会验证使用的是正确的版本。由于我的系统拥有两个版本的java,如下所示:
这样便会造成冲突,因此,需要修改配置文件,指定具体使用哪个版本。
解决方案:
1.设置环境变量:打开文件/etc/profile,添加如下:
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-arm64
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
其中,java-1.8.0-openjdk-arm64为具体指定使用的java版本。
2.执行命令,使之生效:
source /etc/profile
3.最后,查看java的具体版本。
java -version
(以我设置的1.8为例)若为1.8,则指定成功,重新执行测试,成功如下:
SPECjvm2008 Peak
Properties file: none
Benchmarks: startup.helloworld startup.compiler.compiler startup.compiler.sunflow startup.compress startup.crypto.aes startup.crypto.rsa startup.crypto.signverify startup.mpegaudio startup.scimark.fft startup.scimark.lu startup.scimark.monte_carlo startup.scimark.sor startup.scimark.sparse startup.serial startup.sunflow startup.xml.transform startup.xml.validation compiler.compiler compiler.sunflow compress crypto.aes crypto.rsa crypto.signverify derby mpegaudio scimark.fft.large scimark.lu.large scimark.sor.large scimark.sparse.large scimark.fft.small scimark.lu.small scimark.sor.small scimark.sparse.small scimark.monte_carlo serial sunflow xml.transform xml.validation
WARNING: Run will not be compliant.
Property specjvm.run.checksum.validation must be true for publication.
--- --- --- --- --- --- --- --- ---
Benchmark: check
Run mode: static run
Test type: functional
Threads: 1
Iterations: 1
Run length: 1 operation
Iteration 1 (1 operation) begins: Wed Sep 09 20:03:06 CST 2020
Iteration 1 (1 operation) ends: Wed Sep 09 20:03:06 CST 2020
Iteration 1 (1 operation) result: PASSED
Valid run!
--- --- --- --- --- --- --- --- ---
Benchmark: startup.helloworld
Run mode: static run
Test type: single
Threads: 1
Iterations: 1
Run length: 1 operation
Iteration 1 (1 operation) begins: Wed Sep 09 20:03:06 CST 2020
Iteration 1 (1 operation) ends: Wed Sep 09 20:03:06 CST 2020
Iteration 1 (1 operation) result: 148.51 ops/m
Valid run!
Score on startup.helloworld: 148.51 ops/m
--- --- --- --- --- --- --- --- ---
...(省略) ...