Mercurial > hg > graal-compiler
diff src/share/vm/runtime/java.cpp @ 12275:63147986a428
8019835: Strings interned in different threads equal but does not ==
Summary: Add -XX:+VerifyStringTableAtExit option and code to verify StringTable invariants.
Reviewed-by: rdurbin, sspitsyn, coleenp
author | dcubed |
---|---|
date | Wed, 18 Sep 2013 07:02:10 -0700 |
parents | 71180a6e5080 |
children | cefad50507d8 d13d7aba8c12 |
line wrap: on
line diff
--- a/src/share/vm/runtime/java.cpp Tue Sep 17 20:20:03 2013 +0200 +++ b/src/share/vm/runtime/java.cpp Wed Sep 18 07:02:10 2013 -0700 @@ -544,6 +544,19 @@ // 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