RFR: 8264760: JVM crashes when two threads encounter the same resolution error [v3]

David Holmes dholmes at openjdk.java.net
Mon Apr 12 23:55:58 UTC 2021


On Thu, 8 Apr 2021 04:38:37 GMT, Wang Huang <whuang at openjdk.org> wrote:

>> As shown in JDK-8264760, I changed notes with @dholmes-ora and only fixed this issue by deleting the assert. The other whole bigger big will be fixed in the other issue.
>
> Wang Huang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add throw exception

I think the code you have is correct. I've suggested some additional commentary. There are a couple of races possible here, but I think the remaining ones are benign and we do not need to try and impose any stricter synchronization.

Thanks,
David

src/hotspot/share/classfile/systemDictionary.cpp line 1939:

> 1937:     ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which);
> 1938:     if (entry != NULL && entry->nest_host_error() == NULL) {
> 1939:       entry->set_nest_host_error(message);

Please add a comment before line 1939:
// An existing entry means we had a true resolution failure (LinkageError) with our nest host, but we
// still want to add the error message for the higher-level access checks to report. We should
// only reach here under the same error condition, so we can ignore the potential race with setting
// the message. If we see it is already set then we can ignore it.

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

Changes requested by dholmes (Reviewer).

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


More information about the hotspot-runtime-dev mailing list