(11) RFR (S) JDK-8205509: assert(_name_and_id != 0LL) failed: encountered a class loader null name and id
coleen.phillimore at oracle.com
coleen.phillimore at oracle.com
Fri Jun 22 23:28:32 UTC 2018
Lois,
This looks good!
http://cr.openjdk.java.net/~lfoltan/bug_jdk8205509/webrev/src/hotspot/share/classfile/classLoaderData.cpp.udiff.html
if (!h_class_loader.is_null()) {
_class_loader = _handles.add(h_class_loader());
}
+ if (!h_class_loader.is_null()) {
+ _class_loader_klass = h_class_loader->klass();
+ }
+
Can you put the _class_loader_klass under the if statement above it?
+ } else {
+ return _class_loader_klass->external_name();
Can you add short comment: // May be called in a race before
_name_and_id is initialized.
Unfortunately, there isn't a good way to assert this (other than maybe a
flag which would serve the same purpose as a null _name_and_id), and
this code path is sensitive to safepoints because the link from
class_loader to ClassLoaderData and the addition of ClassLoaderData to
the CLDG needs to appear atomic.
Thanks for the speedy fix.
Coleen
On 6/22/18 7:00 PM, Lois Foltan wrote:
> Please review the following change to address a hs-tier5 test failure.
> The recent change for JDK-8202605 aggravated an existing race
> condition within ClassLoaderDataGraph::add() where a given class
> loader's ClassLoaderData structure is added to the
> ClassLoaderDataGraph prior to full initialization of the CLD's
> _class_loader_klass, _name and _name_and_id fields within
> ClassLoaderData::initialize_name_and_klass. To ensure that methods
> loader_name() and loader_name_and_id() always provide a string for the
> class loader name, the fix involved moving the field,
> _class_loader_klass, to the ClassLoaderData's constructor where if
> _name and/or _name_and_id fields are null, a reasonable
> _class_loader_klass's external_name() can be provided.
>
> open webrev http://cr.openjdk.java.net/~lfoltan/bug_jdk8205509/webrev/
> bug link at https://bugs.openjdk.java.net/browse/JDK-8205509
>
> Testing: hs-tier(1-2), jdk-tier(1-3) complete
> hs-tier3-5 in progress
> --test-repeat 50 ran for tier1 platforms of test
> jdk/java/lang/instrument/DaemonThread/TestDaemonThread.java
>
> Thanks,
> Lois
More information about the hotspot-runtime-dev
mailing list