JDK-8234196 : [TESTBUG] DynamicArchiveRelocationTest.java missing "ArchiveRelocationMode == 1 ...."
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2019-11-14
  • Updated: 2019-11-21
  • Resolved: 2019-11-14
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 14
14 b24Fixed
Related Reports
Relates :  
Description
The following test fails in the JDK14 CI:

runtime/cds/appcds/dynamicArchive/DynamicArchiveRelocationTest.java

Here's a snippet from the log file:

----------System.err:(59/4678)----------
 stdout: [[0.042s][debug][cds] Reserved archive_space_rs     [0x00000008536f0000 - 0x0000000854290000] (12189696) bytes
[0.042s][debug][cds] Reserved class_space_rs [0x0000000854290000 - 0x0000000894290000] (1073741824) bytes
[0.042s][info ][cds] Commit static  region #0 at base 0x00000008536f0000 top 0x0000000853700000 (MiscData) exec
[0.042s][info ][cds] Mapped static  region #0 at base 0x00000008536f0000 top 0x0000000853700000 (MiscData)
[0.042s][info ][cds] Commit static  region #1 at base 0x0000000853700000 top 0x0000000853b30000 (ReadWrite)
[0.046s][info ][cds] Mapped static  region #1 at base 0x0000000853700000 top 0x0000000853b30000 (ReadWrite)
[0.046s][info ][cds] Commit static  region #2 at base 0x0000000853b30000 top 0x0000000854250000 (ReadOnly)
[0.051s][info ][cds] Mapped static  region #2 at base 0x0000000853b30000 top 0x0000000854250000 (ReadOnly)
[0.051s][info ][cds] Commit static  region #3 at base 0x0000000854250000 top 0x0000000854260000 (MiscCode)
[0.052s][info ][cds] Mapped static  region #3 at base 0x0000000854250000 top 0x0000000854260000 (MiscCode)
[0.052s][debug][cds,reloc] runtime archive relocation start
[0.052s][debug][cds,reloc] mapped relocation bitmap @ 0x0000000827970000 (196608 bytes = 1482890 bits)
[0.052s][debug][cds,reloc] SharedDataRelocator::_patch_base     = 0x00000008536f0000
[0.052s][debug][cds,reloc] SharedDataRelocator::_patch_end      = 0x0000000854260000
[0.052s][debug][cds,reloc] SharedDataRelocator::_valid_old_base = 0x0000000800000000
[0.052s][debug][cds,reloc] SharedDataRelocator::_valid_old_end  = 0x0000000800b70000
[0.052s][debug][cds,reloc] SharedDataRelocator::_valid_new_base = 0x00000008536f0000
[0.052s][debug][cds,reloc] SharedDataRelocator::_valid_new_end  = 0x0000000854260000
[0.058s][debug][cds,reloc] runtime archive relocation done
[0.058s][info ][cds      ] Commit dynamic region #1 at base 0x0000000854260000 top 0x0000000854270000 (ReadWrite)
[0.058s][info ][cds      ] Mapped dynamic region #1 at base 0x0000000854260000 top 0x0000000854270000 (ReadWrite)
[0.058s][info ][cds      ] Commit dynamic region #2 at base 0x0000000854270000 top 0x0000000854280000 (ReadOnly)
[0.058s][info ][cds      ] Mapped dynamic region #2 at base 0x0000000854270000 top 0x0000000854280000 (ReadOnly)
[0.058s][info ][cds      ] Commit dynamic region #0 at base 0x0000000854280000 top 0x0000000854290000 (MiscData) exec
[0.058s][info ][cds      ] Mapped dynamic region #0 at base 0x0000000854280000 top 0x0000000854290000 (MiscData)
[0.058s][debug][cds,reloc] runtime archive relocation start
[0.058s][debug][cds,reloc] mapped relocation bitmap @ 0x0000000826e00000 (65536 bytes = 8397 bits)
[0.058s][debug][cds,reloc] SharedDataRelocator::_patch_base     = 0x0000000854260000
[0.058s][debug][cds,reloc] SharedDataRelocator::_patch_end      = 0x0000000854290000
[0.058s][debug][cds,reloc] SharedDataRelocator::_valid_old_base = 0x0000000800000000
[0.058s][debug][cds,reloc] SharedDataRelocator::_valid_old_end  = 0x0000000800ba0000
[0.058s][debug][cds,reloc] SharedDataRelocator::_valid_new_base = 0x00000008536f0000
[0.058s][debug][cds,reloc] SharedDataRelocator::_valid_new_end  = 0x0000000854290000
[0.059s][debug][cds,reloc] runtime archive relocation done
Hello World
];
 stderr: []
 exitValue = 0

java.lang.RuntimeException: 'ArchiveRelocationMode == 1: always map archive(s) at an alternative address' missing from stdout/stderr 

	at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:187)
	at DynamicArchiveRelocationTest.lambda$doTest$1(DynamicArchiveRelocationTest.java:126)
	at jdk.test.lib.cds.CDSTestUtils$Result.assertNormalExit(CDSTestUtils.java:147)
	at DynamicArchiveRelocationTest.doTest(DynamicArchiveRelocationTest.java:124)
	at DynamicArchiveTestBase.runTest(DynamicArchiveTestBase.java:70)
	at DynamicArchiveRelocationTest.testInner(DynamicArchiveRelocationTest.java:68)
	at DynamicArchiveRelocationTest.testOuter(DynamicArchiveRelocationTest.java:55)
	at DynamicArchiveRelocationTest.main(DynamicArchiveRelocationTest.java:45)
	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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:833)

JavaTest Message: Test threw exception: java.lang.RuntimeException
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/124164752fe4 User: iklam Date: 2019-11-14 23:08:05 +0000
14-11-2019

To ensure that archive relocation has happened, the test checks for the log message "ArchiveRelocationMode == 1: always map archive(s) at an alternative address". However, in debug builds, this message occurs ONLY if the archive has been successfully mapped at the desired location. See http://hg.openjdk.java.net/jdk/jdk/file/b987ea528c21/src/hotspot/share/memory/filemap.cpp#l1397 In this particular test run, the archive failed to be mapped at the designed location (this is quite common on Windows), so we never execute the line at filemap.cpp:1397. Hence the expected message was not printed. Anyway, the test cases already checks for the following messages: "runtime archive relocation start"; "runtime archive relocation done" so the check for "ArchiveRelocationMode == 1: ..." is redundant and can be removed.
14-11-2019

The failing test was added last night via JDK-8231610. [~iklam] - can you take a look?
14-11-2019