mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
6704010: Internal Error (src/share/vm/interpreter/interpreterRuntime.cpp:1106)
Fixed a race condition in the assertion caused by an unguarded, concurrent access to a GrowableArray object. Reviewed-by: coleenp, dholmes, dsamersoff
This commit is contained in:
parent
7765368022
commit
df6c2c2e63
1 changed files with 13 additions and 2 deletions
|
@ -1193,9 +1193,20 @@ void SignatureHandlerLibrary::add(methodHandle method) {
|
|||
method->set_signature_handler(_handlers->at(handler_index));
|
||||
}
|
||||
}
|
||||
#ifdef ASSERT
|
||||
int handler_index, fingerprint_index;
|
||||
{
|
||||
// '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized
|
||||
// in any way if accessed from multiple threads. To avoid races with another
|
||||
// thread which may change the arrays in the above, mutex protected block, we
|
||||
// have to protect this read access here with the same mutex as well!
|
||||
MutexLocker mu(SignatureHandlerLibrary_lock);
|
||||
handler_index = _handlers->find(method->signature_handler());
|
||||
fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint());
|
||||
}
|
||||
assert(method->signature_handler() == Interpreter::slow_signature_handler() ||
|
||||
_handlers->find(method->signature_handler()) == _fingerprints->find(Fingerprinter(method).fingerprint()),
|
||||
"sanity check");
|
||||
handler_index == fingerprint_index, "sanity check");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue