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

List:       openjdk-serviceability-dev
Subject:    RFR(XS): 8208091: SA: jhsdb jstack --mixed throws UnmappedAddressException on i686
From:       Severin Gehwolf <sgehwolf () redhat ! com>
Date:       2018-07-23 16:27:30
Message-ID: 3227ec7b6a46f8e24882057792c18c84eee934e6.camel () redhat ! com
[Download RAW message or body]

Hi,

Could I please get a review of this one-liner change related to jhsdb
--mixed when attaching to a running Java process? The issue arises when
threads are in native code and that native code has frame pointers not
properly preserved. In such a case the SA performs a simple frame
pointer valididy check: ebp >= esp

However, the code of retrieving the value for esp is incorrect in as
much as it's not in sync with native code in regards to the register
index:

native code => X86ThreadContext.SP
Java code   => X86ThreadContext.ESP

X86ThreadContext.ESP is never being set by the native code. Since
X86ThreadContext.getRegisterAsAddress(X86ThreadContext.ESP) then
returns null, ebp.lessThan(esp) wrongly returns false causing the
issue. This webrev fixes it by using SP as index on the Java side.
Thoughts?

webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8208091/webrev.01/
bug: https://bugs.openjdk.java.net/browse/JDK-8208091

Thanks,
Severin
[prev in list] [next in list] [prev in thread] [next in thread] 

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