RFR: 8328630: Add logging when needed symbols in dll are missing. [v3]
David Holmes
dholmes at openjdk.org
Tue Apr 2 02:02:02 UTC 2024
On Tue, 2 Apr 2024 01:44:25 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>>
>> windows logging
>
> src/hotspot/os/windows/os_windows.cpp line 1295:
>
>> 1293: void* ret = ::GetProcAddress((HMODULE)lib, name);
>> 1294: DWORD errval;
>> 1295: if ((errval = GetLastError()) != 0) {
>
> `GetProcAddress` doesn't clear last-error on success, so you should only be calling `GetLastError` if the return value was null.
That said, why are you duplicating the logic from `os::lasterror` instead of just passing it the buf to fill in?
if (ret == nullptr) {
char buf[512];
os::lasterror(buf, sizeof(buf));
log_debug(os)(...);
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18404#discussion_r1547044480
More information about the hotspot-runtime-dev
mailing list