RFR: 8310874: Runthese30m crashes with klass should be in the placeholders during verification [v2]

David Holmes dholmes at openjdk.org
Fri Aug 18 04:12:36 UTC 2023


On Mon, 31 Jul 2023 14:41:56 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/placeholders.hpp line 121:
>> 
>>> 119: 
>>> 120:   JavaThread*        definer_acquire()     const { return Atomic::load_acquire(&_definer); }
>>> 121:   void               release_set_definer(JavaThread* definer) { Atomic::release_store(&_definer, definer); }
>> 
>> I cannot see any lock-free access to the definer thread that would require these acquire/release semantics. AFAICS all reading and writing of the definer happen under the SD lock - even the `print_on` usage is ultimately under the SD lock.
>
> You're right.  I thought this access required an acquire but it is always after you relock the SystemDictionary_lock, so it will refetch the field from probe ?
> 
> 
>     // Acquire define token for this class/classloader
>     PlaceholderEntry* probe = PlaceholderTable::find_and_add(name_h, loader_data,
>                                                              PlaceholderTable::DEFINE_CLASS, nullptr, THREAD);
> ...
>     while (probe->definer_acquire() != nullptr) {
>       SystemDictionary_lock->wait();
>     }

Yes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14889#discussion_r1297964680


More information about the hotspot-runtime-dev mailing list