RFR: JDK-8288003: log events for os::dll_unload [v3]
Yasumasa Suenaga
ysuenaga at openjdk.java.net
Fri Jun 10 01:32:50 UTC 2022
On Thu, 9 Jun 2022 15:35:27 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> Currently we only log events for os::dll_load, but not for os::dll_unload, this patch adds it. On some platforms (Linux/Windows) we can use OS APIs (e.g. dlinfo on Linux) to log the path of the unloaded shared lib.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> remove whitespace in os_linux.hpp
I think it is better to add null check to dll_unload() because it might be different behavior between Linux and Windows.
GetModuleFileName() on Windows will return the path of executable if NULL is passed to hModule.
https://docs.microsoft.com/ja-JP/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamea
On the other hand, dlinfo() does not mention if NULL is passed in library handle.
https://man7.org/linux/man-pages/man3/dlinfo.3.html
I think dll_unload() is not expexted to unload executable...
-------------
PR: https://git.openjdk.org/jdk/pull/9101
More information about the hotspot-runtime-dev
mailing list