8058737: CodeCache::find_blob fails with 'unsafe access to zombie method'

Remove active ICStubs from zombie nmethods

Reviewed-by: kvn, iveresov
This commit is contained in:
Tobias Hartmann 2014-09-29 08:40:51 +02:00
parent bea6d40f48
commit d63b9025d8
5 changed files with 27 additions and 4 deletions

View file

@ -543,6 +543,10 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
}
// Clear ICStubs to prevent back patching stubs of zombie or unloaded
// nmethods during the next safepoint (see ICStub::finalize).
MutexLocker cl(CompiledIC_lock);
nm->clear_ic_stubs();
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
_zombified_count++;