8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes

Suppress gc_alot during VM init, improve error for SLT uninitialized.

Reviewed-by: jmasa, brutisso, tschatzl
This commit is contained in:
Kim Barrett 2014-11-11 13:39:00 -05:00
parent 692dbfd02d
commit 294a63af5f
5 changed files with 23 additions and 5 deletions

View File

@ -42,8 +42,12 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void VM_CMS_Operation::acquire_pending_list_lock() {
// The caller may block while communicating
// with the SLT thread in order to acquire/release the PLL.
ConcurrentMarkSweepThread::slt()->
manipulatePLL(SurrogateLockerThread::acquirePLL);
SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
if (slt != NULL) {
slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
} else {
SurrogateLockerThread::report_missing_slt();
}
}
void VM_CMS_Operation::release_and_notify_pending_list_lock() {

View File

@ -213,8 +213,12 @@ void VM_CGC_Operation::acquire_pending_list_lock() {
assert(_needs_pll, "don't call this otherwise");
// The caller may block while communicating
// with the SLT thread in order to acquire/release the PLL.
ConcurrentMarkThread::slt()->
manipulatePLL(SurrogateLockerThread::acquirePLL);
SurrogateLockerThread* slt = ConcurrentMarkThread::slt();
if (slt != NULL) {
slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
} else {
SurrogateLockerThread::report_missing_slt();
}
}
void VM_CGC_Operation::release_and_notify_pending_list_lock() {

View File

@ -138,6 +138,13 @@ SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) {
return res;
}
void SurrogateLockerThread::report_missing_slt() {
vm_exit_during_initialization(
"GC before GC support fully initialized: "
"SLT is needed but has not yet been created.");
ShouldNotReachHere();
}
void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) {
MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
assert(_buffer == empty, "Should be empty");

View File

@ -93,6 +93,9 @@ class SurrogateLockerThread: public JavaThread {
public:
static SurrogateLockerThread* make(TRAPS);
// Terminate VM with error message that SLT needed but not yet created.
static void report_missing_slt();
SurrogateLockerThread();
bool is_hidden_from_external_view() const { return true; }

View File

@ -87,7 +87,7 @@ void InterfaceSupport::gc_alot() {
// Short-circuit any possible re-entrant gc-a-lot attempt
if (thread->skip_gcalot()) return;
if (is_init_completed()) {
if (Threads::is_vm_complete()) {
if (++_fullgc_alot_invocation < FullGCALotStart) {
return;