RFR: 8261455: Automatically generate the CDS archive if necessary

Yumin Qi minqi at openjdk.java.net
Mon Dec 27 21:42:14 UTC 2021


On Fri, 24 Dec 2021 01:38:06 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This patch is re-coded after serial fixes related: 8275846, 8276787, 8279018 etc.
>> original description(PR 5997):
>> `----------------------------------------------------------------------------------`
>> When shared archive (dynamic archive) failed to map due to damage of the archive file, dump/run jdk version mismatch or non-existence file etc, the new patch will automatically create a new shared archive if -XX:+AutoCreateSharedArchive specified with the name based on SharedArchiveFile.
>> This is a revised patch based on the old PR: 5077 and after bug 8273152 integrated.
>> `-----------------------------------------------------------------------------------`
>> 
>> Tests: tier1,tier2,tier3,tier4
>> 
>> Thanks
>> Yumin
>
> src/hotspot/share/cds/filemap.cpp line 207:
> 
>> 205:   if (!os::file_exists(_full_path)) {
>> 206:     return false;
>> 207:   }
> 
> Is the above check necessary? If the file doesn't exist, will `check_archive()` below return false?

It is needed here --- when open a file of name is NULL, os::open first does is checking:
if (strlen(path) > MAX_PATH - 1) {
    errno = ENAMETOOLONG;
    return -1;
  }
It will crash on NULL. Removing it will cause many tests fail.  os:file_exists will first check if it is NULL. 
I will add comment for it.

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

PR: https://git.openjdk.java.net/jdk/pull/6920


More information about the hotspot-runtime-dev mailing list