RFR(XS): 8060721: Test runtime/SharedArchiveFile/LimitSharedSizes.java fails in jdk 9 fcs new platforms/compiler

Calvin Cheung calvin.cheung at oracle.com
Wed Nov 5 22:34:47 UTC 2014


Hi Dean,

I've tried your suggestion but got the following compilation error:

Compiling 
/Users/ccheung/jdk9-comp-upgrade/hotspot/src/share/vm/memory/metaspaceShared.cpp
/Users/ccheung/jdk9-comp-upgrade/hotspot/src/share/vm/memory/metaspaceShared.cpp:720:5: 
error: no matching function for call to 'strcat'
     strcat(class_list_path_str, (volatile char *)os::file_separator());
     ^~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/string.h:75:7: 
note: candidate function not viable: 2nd argument ('volatile char *') 
would lose volatile qualifier
char    *strcat(char *, const char *);
          ^
/Users/ccheung/jdk9-comp-upgrade/hotspot/src/share/vm/memory/metaspaceShared.cpp:721:5: 
error: no matching function for call to 'strcat'
     strcat(class_list_path_str, (volatile char *)"classlist");
     ^~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/string.h:75:7: 
note: candidate function not viable: 2nd argument ('volatile char *') 
would lose volatile qualifier
char    *strcat(char *, const char *);
          ^
2 errors generated.

Calvin

On 11/5/2014 1:28 PM, Dean Long wrote:
> I'm just curious if the following also works:
>
>  721     strcat(class_list_path_str, (volatile char 
> *)os::file_separator());
>  722     strcat(class_list_path_str,(volatile char *)"classlist");
>
> dl
>
> On 11/5/2014 11:14 AM, Calvin Cheung wrote:
>> While upgrading the compiler on Mac for jdk9, we found this compiler 
>> bug where it skips the following 2 lines of code in 
>> metaspaceShared.cpp when optimization is enable (set to -Os) for the 
>> fastdebug and product builds.
>>     strcat(class_list_path_str, os::file_separator());
>>     strcat(class_list_path_str, "classlist");
>>
>> The bug is reproducible with Xcode 5.1.1 and 6.1.
>>
>> A workaround fix is to rewrite an "if" block in the 
>> MetaspaceShared::preload_and_dump() method.
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8060721
>>
>> webrev: http://cr.openjdk.java.net/~ccheung/8060721/webrev/
>>
>> Testing:
>>     JPRT
>>     The affected testcase with product, fastdebug, and debug builds 
>> built with Xcode 5.1.1 and 6.1.
>>
>> thanks,
>> Calvin
>



More information about the hotspot-runtime-dev mailing list