--- old/src/hotspot/share/classfile/stringTable.cpp 2017-11-30 14:09:09.452258519 +0100 +++ new/src/hotspot/share/classfile/stringTable.cpp 2017-11-30 14:09:09.200258528 +0100 @@ -152,8 +152,10 @@ for (HashtableEntry* l = bucket(index); l != NULL; l = l->next()) { count++; if (l->hash() == hash) { - oop string = string_object_no_keepalive(l); - if (java_lang_String::equals(string, name, len)) { + if (java_lang_String::equals(string_object_no_keepalive(l), name, len)) { + // We must perform a new load with string_object() that keeps the string + // alive as we must expose the oop as strongly reachable when exiting + // this context, in case the oop gets published. return string_object(l); } }