JDK-8209758 : 2 classes with same name G1PrintCollectionSetClosure cause crash when logging is enabled
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-20
  • Updated: 2019-09-09
  • Resolved: 2018-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11.0.3-oracleFixed 12 b08Fixed
Related Reports
Relates :  
Description
Some tests with enabled logging start crash with SEGV.
Failure is reproduced by running test gc/stress/gcbasher/TestGCBasherWithG1.java with "-Xlog:all=trace:file=all.log"

the stacktrace:

---------------  T H R E A D  ---------------

Current thread (0x00007ff484009800):  VMThread "VM Thread" [stack: 0x00007000083ac000,0x00007000084ac000] [id=13827]

Stack: [0x00007000083ac000,0x00007000084ac000],  sp=0x00007000084aa5f0,  free space=1017k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libsystem_platform.dylib+0x1460]  _platform_memmove$VARIANT$Nehalem+0x60
C  [libsystem_c.dylib+0x3e8eb]  __sfvwrite+0x173
C  [libsystem_c.dylib+0x485ff]  __vfprintf+0x3de5
C  [libsystem_c.dylib+0x6d059]  __v2printf+0x1d9
C  [libsystem_c.dylib+0x5234b]  _vsnprintf+0x19f
C  [libsystem_c.dylib+0x523fe]  vsnprintf+0x50
V  [libjvm.dylib+0xa368bc]  os::vsnprintf(char*, unsigned long, char const*, __va_list_tag*)+0x12
V  [libjvm.dylib+0xa39841]  outputStream::do_vsnprintf(char*, unsigned long, char const*, __va_list_tag*, bool, unsigned long&)+0xb1
V  [libjvm.dylib+0xa39a71]  outputStream::do_vsnprintf_and_write(char const*, __va_list_tag*, bool)+0x61
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
V  [libjvm.dylib+0xc8e4a2]  VM_G1CollectForAllocation::doit()+0xd4
V  [libjvm.dylib+0xc8cc37]  VM_Operation::evaluate()+0x10f
V  [libjvm.dylib+0xc8b943]  VMThread::evaluate_operation(VM_Operation*)+0x11b
V  [libjvm.dylib+0xc8b298]  VMThread::loop()+0x18c
V  [libjvm.dylib+0xc8afd4]  VMThread::run()+0xce
V  [libjvm.dylib+0xa2e644]  thread_native_entry(Thread*)+0x145
C  [libsystem_pthread.dylib+0x3661]  _pthread_body+0x154
C  [libsystem_pthread.dylib+0x350d]  _pthread_body+0x0
C  [libsystem_pthread.dylib+0x2bf9]  thread_start+0xd

Comments
Fix Request This patch fixes G1 failure and keeps G1 codebases in sync between releases. Patch applies cleanly at 11u, and passes hotspot tier1 tests. Additionally, I ran this test without problems: CONF=linux-x86_64-normal-server-fastdebug make images run-test TEST=gc/stress/gcbasher/TestGCBasherWithG1.java TEST_VM_OPTS="-Xlog:all=trace:file=all.log"
15-02-2019

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 instead of http://hg.openjdk.java.net/jdk/jdk/file/d96e6839e83d/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#l2751 so it tried to completely wrong thing...
20-08-2018

The regression test is developed as a part for JDK-8209150.
20-08-2018