RFR: 8350869: os::stat doesn't follow symlinks on Windows [v4]

David Holmes dholmes at openjdk.org
Tue May 20 09:07:58 UTC 2025


On Fri, 16 May 2025 10:21:40 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> This PR addresses an issue on Windows, where a class file could not be loaded by a symbolic link. 
>> 
>> I added a check if a wide path is a symbolic link (soft one) and a method for dereferencing. Both os::stat() and os::open() on Windows now can handle such links.
>> 
>> Tested in tiers 1-3. A separate test added.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8350869: Addressed reviewer's comments, added debug output.

Thanks for updates! Not withstanding my lack of detailed knowledge of the API specifics this looks good to me. A couple of minor nits/queries with the test, but I will hit approve.

test/hotspot/jtreg/runtime/LoadClass/TestSymlinkLoad.java line 52:

> 50: 
> 51:         String subPath = "compiled";
> 52:         destDir = Paths.get(System.getProperty("test.classes"), subPath);

Suggestion:

        String subPath = "compiled";
        
        Path destDir = Paths.get(System.getProperty("test.classes"), subPath);

test/hotspot/jtreg/runtime/LoadClass/TestSymlinkLoad.java line 54:

> 52:         destDir = Paths.get(System.getProperty("test.classes"), subPath);
> 53: 
> 54:         CompilerUtils.compile(sourceDir, destDir);

What exactly is this compiling?

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25233#pullrequestreview-2853351466
PR Review Comment: https://git.openjdk.org/jdk/pull/25233#discussion_r2097422231
PR Review Comment: https://git.openjdk.org/jdk/pull/25233#discussion_r2097425285


More information about the hotspot-runtime-dev mailing list