8261702: ClhsdbFindPC can fail due to PointerFinder incorrectly thinking an address is in a .so

Reviewed-by: ysuenaga, kevinw, sspitsyn
This commit is contained in:
Chris Plummer 2021-02-21 18:59:02 +00:00
parent 564011cff0
commit 539c80bfda

View File

@ -82,17 +82,6 @@ public class PointerFinder {
}
}
// Check if address is a native (C++) symbol
JVMDebugger dbg = VM.getVM().getDebugger();
CDebugger cdbg = dbg.getCDebugger();
if (cdbg != null) {
loc.loadObject = cdbg.loadObjectContainingPC(a);
if (loc.loadObject != null) {
loc.nativeSymbol = loc.loadObject.closestSymbolToPC(a);
return loc;
}
}
// Check if address is in the java heap.
CollectedHeap heap = VM.getVM().getUniverse().heap();
if (heap instanceof GenCollectedHeap) {
@ -198,6 +187,19 @@ public class PointerFinder {
}
}
// Check if address is a native (C++) symbol. Do this last because we don't always
// do a good job of computing if an address is actually within a native lib, and sometimes
// an address outside of a lib will be found as inside.
JVMDebugger dbg = VM.getVM().getDebugger();
CDebugger cdbg = dbg.getCDebugger();
if (cdbg != null) {
loc.loadObject = cdbg.loadObjectContainingPC(a);
if (loc.loadObject != null) {
loc.nativeSymbol = loc.loadObject.closestSymbolToPC(a);
return loc;
}
}
// Fall through; have to return it anyway.
return loc;
}