JDK-8316526 : ciReplay fails with "tag mismatch: wrong class files?" when CDS is disabled
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22,24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2023-09-19
  • Updated: 2024-11-22
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
When running a replay file which was dumped with the flag -XX:-UseCompressedClassPointers, replay compilation fails regardless if we specify -XX:-UseCompressedClassPointers or not. The error message is:

"tag mismatch: wrong class files?" 

A workaround for this problem is to additionally specify -XX:+ReplayIgnoreInitErrors. This still allows to replay the compilation.

The problem can be reproduced with the attached WrongTag.java file:
$ java XX:CompileCommand=DumpReplay,WrongTag::test -Xbatch -XX:-TieredCompilation -XX:CompileOnly=WrongTag::* -XX:-UseCompressedClassPointers WrongTag.java
$ javac WrongTag.java    // Do not run the first command with the class file only
$ java -XX:+ReplayCompiles -XX:ReplayDataFile=replay.log   // replay.log: Insert name of actual replay file


Original report:

make run-test TEST=compiler/ciReplay TEST_VM_OPTS="-XX:-UseCompressedClassPointers"

some tests are failing like this:

java.lang.RuntimeException: Unexpected exit code for positive case: [-XX:-TieredCompilation]: expected 1 to equal 0
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
	at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
	at compiler.ciReplay.CiReplayBase.positiveTest(CiReplayBase.java:271)
	at compiler.ciReplay.TestLambdas.testAction(TestLambdas.java:46)
	at compiler.ciReplay.CiReplayBase.runTest(CiReplayBase.java:131)
	at compiler.ciReplay.TestLambdas.main(TestLambdas.java:41)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1570)

The failure does not seem to be specific to -UseCompressedClassPointers. In project Lilliput we also observe the same failures when running with +UseCompactObjectHeaders. When I hardcode UseCompactObjectHeaders to be on by default, then it only fails with -UseCompactObjectHeaders. This seems to indicate to me that this is a test-bug, but I am not sure,
Comments
With JDK-8344844, I'll add a check to the tests that CDS is enabled and skip them otherwise.
22-11-2024

I just noticed the same failure mode with '-Xshare:off' and since '-XX:-UseCompressedClassPointers' disables CDS as well, I think the underlying issue is that ciReplay does not work if CDS is disabled.
15-08-2024

Not getting enough time to look into this issue, unassigning myself
25-01-2024

Assigning myself to triage this further.
20-09-2023

ILW = Test failures due to replay file dumping problem with -XX:-UseCompressedClassPointers, few cireplay tests, use -XX:+ReplayIgnoreInitErrors to run replay compilation = MML = P4
20-09-2023