mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
8019835: Strings interned in different threads equal but does not ==
Add -XX:+VerifyStringTableAtExit option and code to verify StringTable invariants. Reviewed-by: rdurbin, sspitsyn, coleenp
This commit is contained in:
parent
876967ae1f
commit
41bce440a4
6 changed files with 218 additions and 0 deletions
|
@ -544,6 +544,19 @@ void before_exit(JavaThread * thread) {
|
|||
// it will run into trouble when system destroys static variables.
|
||||
MemTracker::shutdown(MemTracker::NMT_normal);
|
||||
|
||||
if (VerifyStringTableAtExit) {
|
||||
int fail_cnt = 0;
|
||||
{
|
||||
MutexLocker ml(StringTable_lock);
|
||||
fail_cnt = StringTable::verify_and_compare_entries();
|
||||
}
|
||||
|
||||
if (fail_cnt != 0) {
|
||||
tty->print_cr("ERROR: fail_cnt=%d", fail_cnt);
|
||||
guarantee(fail_cnt == 0, "unexpected StringTable verification failures");
|
||||
}
|
||||
}
|
||||
|
||||
#undef BEFORE_EXIT_NOT_RUN
|
||||
#undef BEFORE_EXIT_RUNNING
|
||||
#undef BEFORE_EXIT_DONE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue