RFR: 8317951: Refactor loading of zip library to help resolve JDK-8315220 [v2]

Markus Grönlund mgronlun at openjdk.org
Wed Oct 18 18:49:10 UTC 2023


On Wed, 18 Oct 2023 09:03:09 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> src/hotspot/share/utilities/zipLibrary.cpp line 109:
>> 
>>> 107:  public:
>>> 108:    ZipLibraryLoaderLock() : _jt(nullptr) {
>>> 109:     Thread* thread = Thread::current_or_null_safe();
>> 
>> Why do you need the "safe" version here? can this be called from a signal handling context?
>
> I don't need the safe version, only the Thread::current_or_null() - thanks for pointing this out.

Updated to Thread::current_or_null().

>> src/hotspot/share/utilities/zipLibrary.cpp line 146:
>> 
>>> 144: 
>>> 145: void ZipLibrary::close(jzfile* zip) {
>>> 146:   initialize();
>> 
>> This seems a bit odd, surely if we are closing something we had to open it first, so we should be asserting that initialization has already happened. ??
>
> Well spotted, thanks David. Make sense!

Updated to assert(is_loaded(), "invariant") instead of initialize().

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16149#discussion_r1364360153
PR Review Comment: https://git.openjdk.org/jdk/pull/16149#discussion_r1364360626


More information about the hotspot-runtime-dev mailing list