RFR: 8278239: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine failed with EXCEPTION_ACCESS_VIOLATION at 0x000000000000000d

Coleen Phillimore coleenp at openjdk.java.net
Tue Dec 21 22:44:19 UTC 2021


On Tue, 21 Dec 2021 22:40:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/code/codeCache.cpp line 681:
>> 
>>> 679: void CodeCache::metadata_do(MetadataClosure* f) {
>>> 680:   assert_locked_or_safepoint(CodeCache_lock);
>>> 681:   NMethodIterator iter(NMethodIterator::only_alive);
>> 
>> The `CodeCache::metadata_do` is used in `MetadataOnStackMark::MetadataOnStackMark`.
>> Besides `RedefineClasses` the `MetadataOnStackMark` is also used in `ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces`.
>> Is the change at L681 correct for `ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces`as well?
>
> Yes, in ClassLoaderDataGraph::walk_metadata_and_clean_metaspaces, it calls the version of MetadataOnStackMark that doesn't call CodeCache::metadata_do - it only walks the metadata that was saved from the full redefinition walk:
> 
> caller:
>   MetadataOnStackMark md_on_stack(walk_all_metadata, /*redefinition_walk*/false);
> 
> callee:
>     if (redefinition_walk) {
>       // We have to walk the whole code cache during redefinition.
>       CodeCache::metadata_do(&md_on_stack);
>     } else {
>       CodeCache::old_nmethods_do(&md_on_stack);
>     }
> 
> During redefinition, we have to walk the unloaded nmethods as well as the alive nmethods.

The nmethods in the table are removed when the unloaded nmethods are flushed so that the table doesn't contain stale entries.

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

PR: https://git.openjdk.java.net/jdk/pull/6900


More information about the hotspot-dev mailing list