RFR: 8306767: Concurrent repacking of extra data in MethodData is potentially unsafe

Erik Österlund eosterlund at openjdk.org
Tue Nov 28 16:32:05 UTC 2023


On Tue, 28 Nov 2023 16:23:34 GMT, Tom Rodriguez <never at openjdk.org> wrote:

>> I'm making sure that `allocate_bci_to_data` is only called when holding the `extra_data_lock`, so that no concurrent calls of it can ever occur.
>> 
>> Testing: tier1-3 and stress.
>
> src/hotspot/share/runtime/deoptimization.cpp line 2499:
> 
>> 2497:     // This will let us detect a repeated trap at this point.
>> 2498:     {
>> 2499:       MutexLocker ml(trap_mdo->extra_data_lock());
> 
> Doesn't the lock have to be held over the lifetime of the pdata variable?  Otherwise an intervening safepoint could repack the MDO rendering pdata invalid.

Good point. That was done in a similar place above but not here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16840#discussion_r1408052647


More information about the hotspot-dev mailing list