RR 6313816: SA: jstack -m fails on Win32 : UnalignedAddressException

Staffan Larsen staffan.larsen at oracle.com
Thu May 2 05:52:31 PDT 2013


I think this looks good. Thanks for doing this.

/Staffan

On 30 apr 2013, at 19:02, Kevin Walls <kevin.walls at oracle.com> wrote:

> Hi,
> 
> I'd like some review of this suggestion to fix:
> 6313816 SA windows unaligned address exception
> 
> webrev:
> http://cr.openjdk.java.net/~kevinw/6313816/webrev/
> 
> This bug is a long-standing annoyance, mainly shown by using jstack -m
> 
> Already fixed on Linux with additional sanity checks on ebp/rbp values in
> e.g. LinuxX86CFrame.sender()
> 
> On Windows there isn't such a convenient place to put these checks, as they
> call getAddressValue() which is only part of the specific debugger interfaces
> such as LinuxDebugger, WindbgDebugger, etc.. and on Windows we use
> X86CFrame and AMD64CFrame.  These are constructed with only a
> CDebugger, there is no "WinXXXFrame" class - perhaps there should be!
> 
> That's what  I've tried here, by renaming e.g. X86CFrame to WinX86CFrame,
> and adding the extra sanity checks as we already have in LinuxX86CFrame.
> 
> As files have move thed diff isn't obvious, but in common with some previous changes
> the new bits are x86 and x64 versions of these:
> 
> + // Check alignment of rbp
> + if ( dbg.getAddressValue(rbp) % ADDRESS_SIZE != 0) {
> + return null;
> + }
> +
> 
> and
> 
> - if (nextRBP == null) {
> + if (nextRBP == null || nextRBP.lessThanOrEqual(rbp)) {
> 
> 
> This additional symmetry between the platforms seems to make sense, and
> should help any future changes.
> 
> Thanks
> Kevin
> 



More information about the serviceability-dev mailing list