On Wed, 18 Dec 2024 14:36:41 GMT, Robert Toyonaga <d...@openjdk.org> wrote:

>> src/hotspot/os/windows/os_windows.cpp line 3624:
>> 
>>> 3622: #ifdef ASSERT
>>> 3623:       fileStream fs(stdout);
>>> 3624:       os::print_memory_mappings((char*)start, bytes, &fs);
>> 
>> Why was this change made? tty could be stdout or stderr depending on VM flag 
>> settings.
>
> This change was decided on in the original PR after it was discovered that 
> calling 
> [os::print_memory_mappings](https://github.com/openjdk/jdk/blob/jdk-25%2B2/src/hotspot/os/windows/os_windows.cpp#L3623)
>  from the windows implementation of `os::pd_release_memory` causes a rank 
> conflict between `tty_lock` and `NmtVirtualMemory_lock`. This is getting 
> called from `os::release_memory` [after we've already acquired the lock for 
> NMT](https://github.com/openjdk/jdk/blob/jdk-25%2B2/src/hotspot/share/runtime/os.cpp#L2202-L2203).
> 
> Original discussion here 
> https://github.com/openjdk/jdk/pull/20852#issuecomment-2350882050.

Okay ... still not sure this shouldn't be dynamically determining whether 
stdout or stderr is the right target.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22745#discussion_r1891048323

Reply via email to