RFR(S): JDK-8203481 Incorrect constraint for unextended_sp in frame:safe_for_sender

Dmitry Samersoff dms at samersoff.net
Thu Jun 14 11:36:03 UTC 2018


David,

When we constructing frame [1] we get interpreter_frame_sender_sp from
fp()[unextended_sp_offset = -1] and store it as _unextended_sp.

Previously, interpreter stored caller_sp there.

But it's possible that caller_sp is below or above sp of current frame.

One of such cases is a top level frame when we iterate frames from
JVM_GetStackAccessControlContext. Iteration of recursive frames from JFR
FullStackTrace is the other case.


1.

frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
  // SP is the raw SP from the sender after adapter or interpreter
  // extension.
  intptr_t* sender_sp = this->sender_sp();

  // This is the sp before any possible extension (adapter/locals).
  intptr_t* unextended_sp = interpreter_frame_sender_sp();

...

// sender_sp
intptr_t* frame::interpreter_frame_sender_sp() const {
  assert(is_interpreted_frame(), "interpreted frame expected");
  return (intptr_t*) at(interpreter_frame_sender_sp_offset);
}

-Dmitry\S



On 11.06.2018 00:05, David Holmes wrote:
> Hi Dmitry,
> 
> I have to admit I still can't connect all the pieces here. When we are
> operating in frame::safe_for_sender, what has set _unextended_sp? Can
> you walk through a complete example? I can't quite connect Andrew's
> example to the original problem.
> 
> It still seems to me that the current frame should have:
> 
> sp <= unextended_sp <= stack_base()
> 
> ??
> 
> Thanks,
> David
> 
> On 11/06/2018 2:54 AM, Dmitry Samersoff wrote:
>> Hello Everybody,
>>
>> Please, review updated webrev:
>>
>> http://cr.openjdk.java.net/~dsamersoff/JDK-8203481/webrev.02
>>
>> CR link:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8203481
>>
>> -Dmitry
>>
>> On 05/21/2018 04:44 PM, Dmitry Samersoff wrote:
>>> Hello Everybody,
>>>
>>> Please review small fix
>>>
>>> http://cr.openjdk.java.net/~dsamersoff/JDK-8203481/webrev.01/
>>>
>>> CR:
>>>
>>> https://bugs.openjdk.java.net/browse/JDK-8203481
>>>
>>> Testing:
>>>
>>> jfr tests that depends to safe_for_sender functionality
>>>
>>> ./jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java
>>> ./jdk/jdk/jfr/event/profiling/TestFullStackTrace.java
>>>
>>> fails on AARCH64.
>>>
>>> These tests passed after the fix.
>>>
>>>
>>
>>


-- 
Dmitry Samersoff
http://devnull.samersoff.net
* There will come soft rains ...




More information about the hotspot-runtime-dev mailing list