LogOutputList::wait_until_no_readers has two bugs:
1. It doesn't use Atomic::load to access _active_readers even though _active_readers is stored to using Atomic::store.
2. There's a missing OrderAccess::loadstore at the end to prevent stores from moving above the while loop.
This is buggy on ARM (reminder: independent loads and stores are allowed to be moved freely).
This might be the cause ofJDK-8287420, but as I can't reproduce that ticket I cannot show that this is the case. Therefore, I am making a separate ticket for this fix.
To illustrate the issue, consider this (inlined) call to wait_until_no_readers in LogOutputList::remove_output.
OrderAccess::storeload();
while (_active_readers != 0) {
// Busy wait
}
delete node;
An ARM processor is allowed to do this:
OrderAccess::storeload();
delete node;
while (_active_readers != 0) {
// Busy wait
}
Ouch!
1. It doesn't use Atomic::load to access _active_readers even though _active_readers is stored to using Atomic::store.
2. There's a missing OrderAccess::loadstore at the end to prevent stores from moving above the while loop.
This is buggy on ARM (reminder: independent loads and stores are allowed to be moved freely).
This might be the cause of
To illustrate the issue, consider this (inlined) call to wait_until_no_readers in LogOutputList::remove_output.
OrderAccess::storeload();
while (_active_readers != 0) {
// Busy wait
}
delete node;
An ARM processor is allowed to do this:
OrderAccess::storeload();
delete node;
while (_active_readers != 0) {
// Busy wait
}
Ouch!