mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8173361: various crashes in JvmtiExport::post_compiled_method_load
Don't post information that uses metadata from unloaded nmethods Reviewed-by: eosterlund, dholmes, sspitsyn
This commit is contained in:
parent
67e0f3b490
commit
b1d915ef80
9 changed files with 87 additions and 24 deletions
|
@ -2155,7 +2155,7 @@ jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) {
|
|||
int stackframe = 0;
|
||||
for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) {
|
||||
// sd->method() can be NULL for stubs but not for nmethods. To be completely robust, include an assert that we should never see a null sd->method()
|
||||
assert(sd->method() != NULL, "sd->method() cannot be null.");
|
||||
guarantee(sd->method() != NULL, "sd->method() cannot be null.");
|
||||
record->pcinfo[scope].methods[stackframe] = sd->method()->jmethod_id();
|
||||
record->pcinfo[scope].bcis[stackframe] = sd->bci();
|
||||
stackframe++;
|
||||
|
@ -2166,6 +2166,7 @@ jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) {
|
|||
}
|
||||
|
||||
void JvmtiExport::post_compiled_method_load(nmethod *nm) {
|
||||
guarantee(!nm->is_unloading(), "nmethod isn't unloaded or unloading");
|
||||
if (JvmtiEnv::get_phase() < JVMTI_PHASE_PRIMORDIAL) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue