[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    RR 6313816: SA: jstack -m fails on Win32 : UnalignedAddressException
From:       Kevin Walls <kevin.walls () oracle ! com>
Date:       2013-04-30 17:02:59
Message-ID: 517FF943.6020906 () oracle ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic