RFR: 8338693: assert(Atomic::add(&ik->_shared_class_load_count, 1) == 1) failed: shared class loaded more than once

Coleen Phillimore coleenp at openjdk.org
Tue Sep 17 12:52:06 UTC 2024


On Wed, 11 Sep 2024 21:24:53 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

> The test vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java  occasionally fails due to the number of shared classes being incremented even though the shared class is not loaded. This patch moves the assert to only increment once loading is possible.

load_shared_class() does have exclusive access because it's in the same class loading path as regular class loading.  I was a bit worried about check_shared_class_super_type() bypassing this, but doesn't appear that it does.

>From my debugging of the case where we return null for check_shared_class_super_type() for the interface, the interface did have the shared_loading_failed() misc_flag set, so it appears that fixing all the cases that set this flag properly will fix this bug.

There's a lot of this _method_ and _method_impl_ pattern in this file, so this is okay.

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

PR Comment: https://git.openjdk.org/jdk/pull/20955#issuecomment-2355669725


More information about the hotspot-runtime-dev mailing list