提交 5b7a3b0a 编写于 作者: K kevinw

7178741: SA: jstack -m produce UnalignedAddressException in output (Linux)

Reviewed-by: poonam, sla
上级 4fbeb8df
...@@ -60,8 +60,13 @@ final public class LinuxAMD64CFrame extends BasicCFrame { ...@@ -60,8 +60,13 @@ final public class LinuxAMD64CFrame extends BasicCFrame {
return null; return null;
} }
// Check alignment of rbp
if ( dbg.getAddressValue(rbp) % ADDRESS_SIZE != 0) {
return null;
}
Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE); Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE);
if (nextRBP == null) { if (nextRBP == null || nextRBP.lessThanOrEqual(rbp)) {
return null; return null;
} }
Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE); Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE);
......
...@@ -61,8 +61,13 @@ final public class LinuxX86CFrame extends BasicCFrame { ...@@ -61,8 +61,13 @@ final public class LinuxX86CFrame extends BasicCFrame {
return null; return null;
} }
// Check alignment of ebp
if ( dbg.getAddressValue(ebp) % ADDRESS_SIZE != 0) {
return null;
}
Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE);
if (nextEBP == null) { if (nextEBP == null || nextEBP.lessThanOrEqual(ebp)) {
return null; return null;
} }
Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE); Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册