RFR: 8346433: Cannot use DllMain in hotspot for static builds [v2]
Magnus Ihse Bursie
ihse at openjdk.org
Mon Jan 13 13:50:54 UTC 2025
On Thu, 19 Dec 2024 07:50:49 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Merge branch 'master' into dll-main-in-hotspot
>> - Add explanation
>> - Update comments and copyright year
>> - Restore DllMain
>> - 8346433: Cannot use DllMain in hotspot for static builds
>
> src/hotspot/os/windows/os_windows.cpp line 4418:
>
>> 4416: }
>> 4417: WindowsDbgHelp::pre_initialize();
>> 4418: SymbolEngine::pre_initialize();
>
> As David has pointed out, this is too late. There is a reason we added this to DllMain - we need this initialized very early in case we crash before this point. We still will want useful hs-err files.
Unfortunately, this is as early as we can get in for static builds. We will just have to accept that any crash during startup of static builds will not be able to generated proper hs_err files. :-(
I did move it back to DllMain for non-static builds (which, after all, is the by far most common), so nothing will change there.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22793#discussion_r1913218679
More information about the hotspot-runtime-dev
mailing list