RFR: 8209758: 2 classes with same name G1PrintCollectionSetClosure cause crash when logging is enabled

Leonid Mesnik leonid.mesnik at oracle.com
Mon Aug 20 22:25:40 UTC 2018


Hi

Could you please review small fix which rename class G1PrintCollectionSetClosure in g1CollectionSet.cpp.

While I was developing test for JDK-8209150 <https://bugs.openjdk.java.net/browse/JDK-8209150> [TESTBUG] Add logging to verify JDK-8197901 to a different test 
I observed SEGV on macosx. Actually a lot of tests fail because of this same issue when logging is enabled.

The tests fail with SEGV in 
V  [libjvm.dylib+0xa39bbf]  outputStream::print_cr(char const*, ...)+0x81
V  [libjvm.dylib+0x536e6b]  G1PrintCollectionSetClosure::do_heap_region(HeapRegion*)+0x11b
V  [libjvm.dylib+0x535864]  G1CollectionSet::iterate_from(HeapRegionClosure*, unsigned int, unsigned int) const+0x54
V  [libjvm.dylib+0x52a2d2]  G1CollectedHeap::do_collection_pause_at_safepoint(double)+0x7f2


because class 'G1PrintCollectionSetClosure' is used from
http://hg.openjdk.java.net/jdk/jdk/file/d96e6839e83d/src/hotspot/share/gc/g1/g1CollectionSet.cpp#l331 <http://hg.openjdk.java.net/jdk/jdk/file/d96e6839e83d/src/hotspot/share/gc/g1/g1CollectionSet.cpp#l331>
instead of 
http://hg.openjdk.java.net/jdk/jdk/file/d96e6839e83d/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#l2751 <http://hg.openjdk.java.net/jdk/jdk/file/d96e6839e83d/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#l2751>
so it tries to do completely wrong thing... 

I think it would be enough just to rename one of classes to avoid confusion.

webrev: http://cr.openjdk.java.net/~lmesnik/8209758/webrev.00/ <http://cr.openjdk.java.net/~lmesnik/8209758/webrev.00/>
bug: https://bugs.openjdk.java.net/browse/JDK-8209758 <https://bugs.openjdk.java.net/browse/JDK-8209758>
I run gc & serviceability tests with enabled logging to verify that they work fine now.

The separate regression test which fails without any additional options will be integrated as fix for https://bugs.openjdk.java.net/browse/JDK-8209150 <https://bugs.openjdk.java.net/browse/JDK-8209150>
Leonid


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20180820/393a1e4c/attachment.htm>


More information about the hotspot-gc-dev mailing list