compiler/compilercontrol/parser/DirectiveParserTest.java is failing in the assertion in ~PtrQueue after the removal by JDK-8240133 of the "unnecessary" call to G1DirtyCardQueue::flush() by ~G1DirtyCardQueue(). The failed assertion is "assert(_buf == __null) failed". As discussed in that CR, that flush should not be necessary, as it occurs too late. If a thread adds entries to its dirty card queue after being detached but before being deleted, that's a bug, and the flush was only serving to mask such. Well, it looks like there is indeed a bug being masked.
This seems to only show up with graal. My testing missed this because I was mostly running with graal tests disabled, because of other changes in the same repo that did not yet support graal.
Command Line: -XX:MaxRAMPercentage=12 -XX:+CreateCoredumpOnCrash -ea -esa -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal -XX:+TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesLimit=1000 -XX:CompilerDirectivesFile=non-matching.json
Current thread (0x00007f7f81803800): Thread [stack: 0x0000000104ed0000,0x0000000104fd0000] [id=6659]
Stack: [0x0000000104ed0000,0x0000000104fd0000], sp=0x0000000104fcf830, free space=1022k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0xb44db7] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6e5
V [libjvm.dylib+0xb454d3] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x47
V [libjvm.dylib+0x3386b4] report_vm_error(char const*, int, char const*, char const*, ...)+0x145
V [libjvm.dylib+0x9a93d0] PtrQueue::~PtrQueue()+0x36
V [libjvm.dylib+0x3e684c] G1BarrierSet::on_thread_destroy(Thread*)+0x1a
V [libjvm.dylib+0xab8700] Thread::~Thread()+0x6e
V [libjvm.dylib+0xabb810] JavaThread::~JavaThread()+0xe
V [libjvm.dylib+0xac22b9] Threads::create_vm(JavaVMInitArgs*, bool*)+0x66d
V [libjvm.dylib+0x5e2969] JNI_CreateJavaVM+0x8a
C [libjli.dylib+0x3ee9] JavaMain+0x10b
C [libjli.dylib+0x6b9a] ThreadJavaMain+0x9
C [libsystem_pthread.dylib+0x3661] _pthread_body+0x154
C [libsystem_pthread.dylib+0x350d] _pthread_body+0x0
C [libsystem_pthread.dylib+0x2bf9] thread_start+0xd
This seems to only show up with graal. My testing missed this because I was mostly running with graal tests disabled, because of other changes in the same repo that did not yet support graal.
Command Line: -XX:MaxRAMPercentage=12 -XX:+CreateCoredumpOnCrash -ea -esa -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal -XX:+TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:CompilerDirectivesLimit=1000 -XX:CompilerDirectivesFile=non-matching.json
Current thread (0x00007f7f81803800): Thread [stack: 0x0000000104ed0000,0x0000000104fd0000] [id=6659]
Stack: [0x0000000104ed0000,0x0000000104fd0000], sp=0x0000000104fcf830, free space=1022k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.dylib+0xb44db7] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6e5
V [libjvm.dylib+0xb454d3] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x47
V [libjvm.dylib+0x3386b4] report_vm_error(char const*, int, char const*, char const*, ...)+0x145
V [libjvm.dylib+0x9a93d0] PtrQueue::~PtrQueue()+0x36
V [libjvm.dylib+0x3e684c] G1BarrierSet::on_thread_destroy(Thread*)+0x1a
V [libjvm.dylib+0xab8700] Thread::~Thread()+0x6e
V [libjvm.dylib+0xabb810] JavaThread::~JavaThread()+0xe
V [libjvm.dylib+0xac22b9] Threads::create_vm(JavaVMInitArgs*, bool*)+0x66d
V [libjvm.dylib+0x5e2969] JNI_CreateJavaVM+0x8a
C [libjli.dylib+0x3ee9] JavaMain+0x10b
C [libjli.dylib+0x6b9a] ThreadJavaMain+0x9
C [libsystem_pthread.dylib+0x3661] _pthread_body+0x154
C [libsystem_pthread.dylib+0x350d] _pthread_body+0x0
C [libsystem_pthread.dylib+0x2bf9] thread_start+0xd
- relates to
-
JDK-8240774 [REDO] G1DirtyCardQueue destructor has useless flush
- Resolved
-
JDK-8240133 G1DirtyCardQueue destructor has useless flush
- Closed