RFR: 8293010: JDI ObjectReference/referringObjects/referringObjects001 fails assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) failed: checking

Serguei Spitsyn sspitsyn at openjdk.org
Fri Sep 2 01:15:54 UTC 2022


On Wed, 31 Aug 2022 21:47:05 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> The problem is that the following assert in the JvmtiExport::post_object_free is wrong:
> `  assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE), "checking");`
> 
> Even though the condition was checked before, it can be changed later as it is racy by JVM TI design.
> It has to be replaced with the check:
> 
>   if (!env->is_enabled(JVMTI_EVENT_OBJECT_FREE)) {
>     return; // the event type has been already disabled
>   }
> 
> 
> In progress: mach5 nsk.jvmti and nsk.jdi test runs.

Chris, Zhengyu and Leonid, thank you for review!

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

PR: https://git.openjdk.org/jdk/pull/10109


More information about the hotspot-dev mailing list