RFR: 8356597: AOT cache and CDS archive should not be created in read-only mode

Aleksey Shipilev shade at openjdk.org
Fri May 9 11:31:52 UTC 2025


On Fri, 9 May 2025 06:20:47 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> For some unknown historical reasons, AOT caches and CDS archives have been created in read-only mode. This makes them hard to delete, causing problems when running tests that creates a lot of these files.
> 
> Since all other JDK tools create binary files in read-write mode, AOT caches and CDS archives should do the same.

src/hotspot/share/cds/filemap.cpp line 750:

> 748:   // allow processes that have it open continued access to the file.
> 749:   remove(_full_path);
> 750:   int fd = os::open(_full_path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0666);

Why `0666`, though, i.e. world-writable? None of the tools, AFAICS from your examples, do world-writability. Should be `0644`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25137#discussion_r2081477375


More information about the hotspot-runtime-dev mailing list