RFR: 8256830: misc tests failed with "assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking" [v2]

David Holmes dholmes at openjdk.java.net
Tue Dec 1 02:25:55 UTC 2020


On Mon, 30 Nov 2020 12:57:36 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiTagMap.cpp line 1162:
>> 
>>> 1160:   if (_needs_cleaning) {
>>> 1161:     // Recheck whether to post object free events under the lock.
>>> 1162:     post_object_free = post_object_free && env()->is_enabled(JVMTI_EVENT_OBJECT_FREE);
>> 
>> Where is `is_enabled` called without the lock being held in a caller of `remove_dead_entries()`?
>
> void JvmtiTagMap::flush_object_free_events() {
>   assert_not_at_safepoint();
>   if (env()->is_enabled(JVMTI_EVENT_OBJECT_FREE)) {
> 
> Called by JVMTI to disable events and called by the service thread.  And here for get_objects_with_tags:
> 
>   if (collector.some_dead_found() && env()->is_enabled(JVMTI_EVENT_OBJECT_FREE)) {
>     post_dead_objects_on_vm_thread();
>   }

That isn't quite what I asked. The claim is that `remove_dead_entries_locked` needs to recheck `is_enabled` if `post_object_free` is true in case the enabled state changed from true to false. But I can't see how such a situation can arise. In `flush_object_free_events` we only call `remove_dead_entries(false)` and that is when events were seen to be disabled.

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

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


More information about the hotspot-dev mailing list