RFR: 8297543: runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java fail with jfx

Leslie Zhai lzhai at openjdk.org
Thu Nov 24 06:27:22 UTC 2022


On Thu, 24 Nov 2022 05:58:10 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Hi,
>> 
>> configure --with-import-modules=modular-sdk
>> 
>> make run-test CONF=fastdebug TEST="runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java" failed:
>> 
>> 
>> STDERR:
>> java.lang.RuntimeException: javafx.controls requires javafx.base jrt:/javafx.base is different from javafx.base requires jdk.jfr jrt:/jdk.jfr
>>         at TestCommon.checkOutputStrings(TestCommon.java:657)
>>         at ArchivedModuleCompareTest.main(ArchivedModuleCompareTest.java:82)
>>         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>>         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>>         at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
>>         at java.base/java.lang.Thread.run(Thread.java:833)
>> 
>> 
>> debug patch:
>> 
>> 
>> diff --git a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java
>> index 00ef746123f..5501e8264e0 100644
>> --- a/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java
>> +++ b/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java
>> @@ -75,6 +75,10 @@ public class ArchivedModuleCompareTest {
>>          TestCommon.checkExec(output);
>>          if (output.getStderr().contains("sharing")) {
>>              String moduleResolutionOut2 = TestCommon.filterOutLogs(output.getStdout());
>> + System.out.println("************************* moduleResolutionOut1 ***************************");
>> + System.out.println(moduleResolutionOut1);
>> + System.out.println("************************* moduleResolutionOut2 ***************************");
>> + System.out.println(moduleResolutionOut2);
>>              TestCommon.checkOutputStrings(
>>                  moduleResolutionOut1, moduleResolutionOut2, "\n");
>>          }
>> 
>> 
>> There are 2 javafx.base in the moduleResolutionOut2:
>> 
>> 
>> javafx.base requires jdk.jfr jrt:/jdk.jfr
>> javafx.base requires java.desktop jrt:/java.desktop
>> 
>> 
>> So it needs to find sa1's elements in the sa2.
>> 
>> Please review the patch.
>> 
>> Thanks,
>> Leslie Zhai
>
> I don't think this is right. That function is supposed to be comparing two sets of elements that once sorted are expected to be identical**. You seem to have found a situation where s2 has extra elements compared to s1 and so there is a mismatch. I would think the problem needs to be addressed higher up the call chain as the two strings perhaps should not be different, or else the specific test should be adjusted.
> 
> ** The code doesn't actually check they are identical only that s1 is a prefix of s2 once sorted. Not sure if that is intentional or a bug.

Hi @dholmes-ora 

Thanks for your kind response.

jdk17u-dev configured --with-import-modules= jfx modular-sdk will reproduce the issue, but jdk is not able to.

There is `requires static` in the [modules/javafx.base/src/main/java/module-info.java](https://github.com/openjdk/jfx/blob/master/modules/javafx.base/src/main/java/module-info.java#L35)


module javafx.base {
    requires java.desktop;
=>    requires static jdk.jfr;


> There are 2 javafx.base in the moduleResolutionOut2:


=>javafx.base requires jdk.jfr jrt:/jdk.jfr
javafx.base requires java.desktop jrt:/java.desktop


But I could not find the root cause why jdk correctly treat `requires static` via `git log`,  because jdk refactoried `cds` compared with jdk17u-dev, it is not easy to identify which commit "fix" the issue.

Thanks,
Leslie Zhai

-------------

PR: https://git.openjdk.org/jdk/pull/11343


More information about the hotspot-runtime-dev mailing list