Bug when walking entry frame...?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug when walking entry frame...?

Peter Helfer-2
Hi all

I'm seeing this error.. I can make a workaround, but is this the intended behavior ?

#>cd openjdk/control/build/linux-i586-debug/bin
#>./java
-------------------
Frame ID:               b7db7c04
Testers:
 is_interpreted_frame():        true
 is_java_frame():               true
 is_entry_frame():              false
 is_native_frame():             false
 is_runtime_frame():            false
 is_compiled_frame():           false
 is_safepoint_blob_frame():     false
 is_deoptimized():              false
 is_first_frame():                      false
 is_first_java_frame():         true
 is_interpreted_frame_valid():  true
 should_be_deoptimized():       false
 can_be_deoptimized():          false
frame size:             11
sender frame:           b7db7c30
real sender frame:      b7db7c30
-------------------
Frame ID:               b7db7c30
Testers:
 is_interpreted_frame():        false
 is_java_frame():               false
 is_entry_frame():              true
 is_native_frame():             false
 is_runtime_frame():            false
 is_compiled_frame():           false
 is_safepoint_blob_frame():     false
 is_deoptimized():              false
 is_first_frame():                      true
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/frame_i486.cpp:148
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (/home/phelfer/workspace/openjdk/hotspot/src/cpu/i486/vm/frame_i486.cpp:148), pid=29739, tid=3084618640
#  Error: assert(!entry_frame_is_first(),"next Java fp must be non zero")
#

The code that leads to it:

print_custom(){
 [...]
 RegisterMap(thread, false); // happens as well with 'true'
 tty->print_cr(" is_first_java_frame():\t\t%s", is_first_java_frame() ? "true" : "false");
 tty->print_cr(" is_interpreted_frame_valid():\t%s", is_interpreted_frame_valid() ? "true" : "false");
 tty->print_cr(" should_be_deoptimized():\t%s", should_be_deoptimized() ? "true" : "false");
 tty->print_cr(" can_be_deoptimized():\t\t%s", can_be_deoptimized() ? "true" : "false");
 tty->print_cr("frame size:\t\t%d", frame_size());
 tty->print_cr("sender frame:\t\t%x", sender(&map).id());
 tty->print_cr("real sender frame:\t%x", real_sender(&map).id());

}

frame frame::sender(RegisterMap* map) const {
  // Default is we done have to follow them. The sender_for_xxx will
  // update it accordingly
  map->set_include_argument_oops(false);

  if (is_entry_frame())       return sender_for_entry_frame(map);
  if (is_interpreted_frame()) return sender_for_interpreter_frame(map);
  assert(_cb == CodeCache::find_blob(pc()),"Must be the same");

  if (_cb != NULL) {
    return sender_for_compiled_frame(map);
  }
  // Must be native-compiled frame, i.e. the marshaling code for native
  // methods that exists in the core system.
  return frame(sender_sp(), link(), sender_pc());
}

frame frame::sender_for_entry_frame(RegisterMap* map) const {
  assert(map != NULL, "map must be set");
  // Java frame called from C; skip all C frames and return top C
  // frame of that chunk as the sender
  JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
  assert(!entry_frame_is_first(), "next Java fp must be non zero");
  assert(jfa->last_Java_sp() > _sp, "must be above this frame on stack");
  map->clear();
 


Regards, Peter






Reply | Threaded
Open this post in threaded view
|

Re: Bug when walking entry frame...?

Tom Rodriguez
I think you're asking for the sender of the oldest frame which doesn't have a
sender.  It only safe to call sender if !is_first_frame() which is basically
what the assert is complaining about.  By the way it also may be not safe to
call is_interpreted_frame_valid() on something that isn't an interpreter frame.

tom

Peter Helfer wrote:

> Hi all
>
> I'm seeing this error.. I can make a workaround, but is this the
> intended behavior ?
>
> #>cd openjdk/control/build/linux-i586-debug/bin
> #>./java
> -------------------
> Frame ID:               b7db7c04
> Testers:
>  is_interpreted_frame():        true
>  is_java_frame():               true
>  is_entry_frame():              false
>  is_native_frame():             false
>  is_runtime_frame():            false
>  is_compiled_frame():           false
>  is_safepoint_blob_frame():     false
>  is_deoptimized():              false
>  is_first_frame():                      false
>  is_first_java_frame():         true
>  is_interpreted_frame_valid():  true
>  should_be_deoptimized():       false
>  can_be_deoptimized():          false
> frame size:             11
> sender frame:           b7db7c30
> real sender frame:      b7db7c30
> -------------------
> Frame ID:               b7db7c30
> Testers:
>  is_interpreted_frame():        false
>  is_java_frame():               false
>  is_entry_frame():              true
>  is_native_frame():             false
>  is_runtime_frame():            false
>  is_compiled_frame():           false
>  is_safepoint_blob_frame():     false
>  is_deoptimized():              false
>  is_first_frame():                      true
> # To suppress the following error report, specify this argument
> # after -XX: or in .hotspotrc:  SuppressErrorAt=/frame_i486.cpp:148
> #
> # An unexpected error has been detected by Java Runtime Environment:
> #
> #  Internal Error
> (/home/phelfer/workspace/openjdk/hotspot/src/cpu/i486/vm/frame_i486.cpp:148),
> pid=29739, tid=3084618640
> #  Error: assert(!entry_frame_is_first(),"next Java fp must be non zero")
> #
>
> The code that leads to it:
>
> print_custom(){
>  [...]
>  RegisterMap(thread, false); // happens as well with 'true'
>  tty->print_cr(" is_first_java_frame():\t\t%s", is_first_java_frame() ?
> "true" : "false");
>  tty->print_cr(" is_interpreted_frame_valid():\t%s",
> is_interpreted_frame_valid() ? "true" : "false");
>  tty->print_cr(" should_be_deoptimized():\t%s", should_be_deoptimized()
> ? "true" : "false");
>  tty->print_cr(" can_be_deoptimized():\t\t%s", can_be_deoptimized() ?
> "true" : "false");
>  tty->print_cr("frame size:\t\t%d", frame_size());
>  tty->print_cr("sender frame:\t\t%x", sender(&map).id());
>  tty->print_cr("real sender frame:\t%x", real_sender(&map).id());
>
> }
>
> frame frame::sender(RegisterMap* map) const {
>   // Default is we done have to follow them. The sender_for_xxx will
>   // update it accordingly
>   map->set_include_argument_oops(false);
>
>   if (is_entry_frame())       return sender_for_entry_frame(map);
>   if (is_interpreted_frame()) return sender_for_interpreter_frame(map);
>   assert(_cb == CodeCache::find_blob(pc()),"Must be the same");
>
>   if (_cb != NULL) {
>     return sender_for_compiled_frame(map);
>   }
>   // Must be native-compiled frame, i.e. the marshaling code for native
>   // methods that exists in the core system.
>   return frame(sender_sp(), link(), sender_pc());
> }
>
> frame frame::sender_for_entry_frame(RegisterMap* map) const {
>   assert(map != NULL, "map must be set");
>   // Java frame called from C; skip all C frames and return top C
>   // frame of that chunk as the sender
>   JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
>   assert(!entry_frame_is_first(), "next Java fp must be non zero");
>   assert(jfa->last_Java_sp() > _sp, "must be above this frame on stack");
>   map->clear();
>  
>
>
> Regards, Peter
>
>
>
>
>
>