On Mon, 19 Oct 2026 22:44:28 GMT, Serguei Spitsyn <[email protected]> wrote:
>> Yunbo Zhang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> 8392135: Unified logging creates extra log files
>>
>> Use virtual output name matching instead of identifying output types by
>> name prefixes and downcasting. Add coverage for file and standard output
>> matching.
>
> src/hotspot/share/logging/logFileOutput.cpp line 62:
>
>> 60: return false;
>> 61: }
>> 62: char* file_name = make_file_name(name + strlen(Prefix), _pid_str,
>> _vm_start_time_str);
>
> Q2: Does this call to `make_file_name()` work correctly/reliably on Windows?
> The implementation of the`make_file_name()` might open the same files with
> different flags like below:
>
> static HANDLE create_read_only_file_handle(const char* file) {
> . . .
> HANDLE handle = ::CreateFileW(wide_path, 0, FILE_SHARE_READ,
> nullptr, OPEN_EXISTING,
> FILE_ATTRIBUTE_NORMAL, nullptr);
> . . .
> }
>
> bool os::same_files(const char* file1, const char* file2) {
> . . .
> HANDLE handle1 = create_read_only_file_handle(native_file1);
> HANDLE handle2 = create_read_only_file_handle(native_file2);
> . . .
>
> It can be a pre-existed problem though.
I tested HotSpot's `os::same_files()` on Windows 11 x64 with 25.0.4.
All three cases correctly identified the same file:
- `probe.log` and `./probe.log`, without a log writer.
- `probe.log` and `./probe.log`, with the log stream kept open using
`-Xlog:logging=error:file=probe.log::filecount=0`.
- `probe.log` and its absolute path, with the log stream kept open.
I did not reproduce a sharing conflict in these cases. The existing sharing
flags look fine to me.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33090#discussion_r4335946207