8294160: misc crash dump improvements
Reviewed-by: dholmes, vlivanov
This commit is contained in:
parent
8873192433
commit
6f8f28e756
@ -627,9 +627,7 @@ int JVM_HANDLE_XXX_SIGNAL(int sig, siginfo_t* info,
|
|||||||
#ifndef ZERO
|
#ifndef ZERO
|
||||||
// Check for UD trap caused by NOP patching.
|
// Check for UD trap caused by NOP patching.
|
||||||
// If it is, patch return address to be deopt handler.
|
// If it is, patch return address to be deopt handler.
|
||||||
if (!signal_was_handled) {
|
if (!signal_was_handled && pc != NULL && os::is_readable_pointer(pc)) {
|
||||||
address pc = os::Posix::ucontext_get_pc(uc);
|
|
||||||
assert(pc != NULL, "");
|
|
||||||
if (NativeDeoptInstruction::is_deopt_at(pc)) {
|
if (NativeDeoptInstruction::is_deopt_at(pc)) {
|
||||||
CodeBlob* cb = CodeCache::find_blob(pc);
|
CodeBlob* cb = CodeCache::find_blob(pc);
|
||||||
if (cb != NULL && cb->is_compiled()) {
|
if (cb != NULL && cb->is_compiled()) {
|
||||||
|
@ -129,6 +129,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
|
|||||||
intptr_t* sp;
|
intptr_t* sp;
|
||||||
intptr_t* fp;
|
intptr_t* fp;
|
||||||
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
||||||
|
if (!is_readable_pointer(epc)) {
|
||||||
|
// Try to recover from calling into bad memory
|
||||||
|
// Assume new frame has not been set up, the same as
|
||||||
|
// compiled frame stack bang
|
||||||
|
return fetch_compiled_frame_from_context(ucVoid);
|
||||||
|
}
|
||||||
return frame(sp, fp, epc);
|
return frame(sp, fp, epc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,7 +354,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
|
|||||||
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
||||||
// point to garbage if entry point in an nmethod is corrupted. Leave
|
// point to garbage if entry point in an nmethod is corrupted. Leave
|
||||||
// this at the end, and hope for the best.
|
// this at the end, and hope for the best.
|
||||||
address pc = os::Posix::ucontext_get_pc(uc);
|
address pc = os::fetch_frame_from_context(uc).pc();
|
||||||
print_instructions(st, pc, 4/*native instruction size*/);
|
print_instructions(st, pc, 4/*native instruction size*/);
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
@ -143,6 +143,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
|
|||||||
intptr_t* sp;
|
intptr_t* sp;
|
||||||
intptr_t* fp;
|
intptr_t* fp;
|
||||||
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
||||||
|
if (!is_readable_pointer(epc)) {
|
||||||
|
// Try to recover from calling into bad memory
|
||||||
|
// Assume new frame has not been set up, the same as
|
||||||
|
// compiled frame stack bang
|
||||||
|
return fetch_compiled_frame_from_context(ucVoid);
|
||||||
|
}
|
||||||
return frame(sp, fp, epc);
|
return frame(sp, fp, epc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,7 +588,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
|
|||||||
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
||||||
// point to garbage if entry point in an nmethod is corrupted. Leave
|
// point to garbage if entry point in an nmethod is corrupted. Leave
|
||||||
// this at the end, and hope for the best.
|
// this at the end, and hope for the best.
|
||||||
address pc = os::Posix::ucontext_get_pc(uc);
|
address pc = os::fetch_frame_from_context(uc).pc();
|
||||||
print_instructions(st, pc, sizeof(char));
|
print_instructions(st, pc, sizeof(char));
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
@ -320,6 +320,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
|
|||||||
intptr_t* sp;
|
intptr_t* sp;
|
||||||
intptr_t* fp;
|
intptr_t* fp;
|
||||||
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
|
||||||
|
if (!is_readable_pointer(epc)) {
|
||||||
|
// Try to recover from calling into bad memory
|
||||||
|
// Assume new frame has not been set up, the same as
|
||||||
|
// compiled frame stack bang
|
||||||
|
return frame(sp + 1, fp, (address)*sp);
|
||||||
|
}
|
||||||
return frame(sp, fp, epc);
|
return frame(sp, fp, epc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,7 +462,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
|
|||||||
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
// Note: it may be unsafe to inspect memory near pc. For example, pc may
|
||||||
// point to garbage if entry point in an nmethod is corrupted. Leave
|
// point to garbage if entry point in an nmethod is corrupted. Leave
|
||||||
// this at the end, and hope for the best.
|
// this at the end, and hope for the best.
|
||||||
address pc = (address)uc->REG_PC;
|
address pc = os::fetch_frame_from_context(uc).pc();
|
||||||
print_instructions(st, pc, sizeof(char));
|
print_instructions(st, pc, sizeof(char));
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
@ -2323,6 +2323,8 @@ bool Method::is_valid_method(const Method* m) {
|
|||||||
} else if ((intptr_t(m) & (wordSize-1)) != 0) {
|
} else if ((intptr_t(m) & (wordSize-1)) != 0) {
|
||||||
// Quick sanity check on pointer.
|
// Quick sanity check on pointer.
|
||||||
return false;
|
return false;
|
||||||
|
} else if (!os::is_readable_range(m, m + 1)) {
|
||||||
|
return false;
|
||||||
} else if (m->is_shared()) {
|
} else if (m->is_shared()) {
|
||||||
return CppVtables::is_valid_shared_method(m);
|
return CppVtables::is_valid_shared_method(m);
|
||||||
} else if (Metaspace::contains_non_shared(m)) {
|
} else if (Metaspace::contains_non_shared(m)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user