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

Markus Grönlund mgronlun at openjdk.org
Wed Oct 18 09:05:35 UTC 2023


On Wed, 18 Oct 2023 02:30:22 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Greetings,
>> 
>> This refactorization resolves the problem associated with [JDK-8315220](https://bugs.openjdk.org/browse/JDK-8315220) and, subsequently, [JDK-8315892](https://bugs.openjdk.org/browse/JDK-8315892).
>> 
>> Testing: jdk_jfr, tier1-9, stress testing
>> 
>> Thanks
>> Markus
>
> 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 needed the safe version here because it can be called early enough in the VM bootstrap where the current thread is not yet initialized. Will check again where this comes from during bootstrap.

> 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!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16149#discussion_r1363519515
PR Review Comment: https://git.openjdk.org/jdk/pull/16149#discussion_r1363517868


More information about the hotspot-runtime-dev mailing list