[PING] RFR(XS): 8208091: SA: jhsdb jstack --mixed throws UnmappedAddressException on i686

Severin Gehwolf sgehwolf at redhat.com
Thu Jul 26 07:33:32 UTC 2018


On Mon, 2018-07-23 at 18:27 +0200, Severin Gehwolf wrote:
> 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

Anyone willing to review this one-liner?

Thanks,
Severin

> Thanks,
> Severin



More information about the serviceability-dev mailing list