JDK-6490042 : Bogus assert in InterpreterMacroAssembler::call_VM_leaf_base
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: x86
  • Submitted: 2006-11-03
  • Updated: 2012-10-08
  • Resolved: 2006-11-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Description
In interp_masm_i486.cpp, InterpreterMacroAssembler::call_VM_leaf_base contains a
bogus assert that the fix for 6481691 occassionally triggers.

Steve Goldman found and removed the bogus assert as part of other work, but the
fix hasn't made it back into any group workspace.

This is the bogus assert

#ifdef ASSERT
  { Label L;
    cmpl(esi, Address(ebp, frame::interpreter_frame_bcx_offset * wordSize));
    jcc(Assembler::equal, L);
    stop("InterpreterMacroAssembler::call_VM_leaf_base: esi not callee saved?");    bind(L);
  }
  { Label L;
    cmpl(edi, Address(ebp, frame::interpreter_frame_locals_offset * wordSize));
    jcc(Assembler::equal, L);
    stop("InterpreterMacroAssembler::call_VM_leaf_base: edi not callee saved?");    bind(L);
  }
#endif

Essentially, we're checking that esi and edi have the same values they had when
before we called out to the runtime.  We do not, however, want to save them here,
as noted in a previous comment

  // Note: No need to save/restore bcp & locals (esi & edi) pointer
  //       since these are callee saved registers and no blocking/
  //       GC can happen in leaf calls.

Comments
EVALUATION Ok.
03-11-2006

SUGGESTED FIX Remove the bogus assert. 23a24,29 > // Further Note: DO NOT save/restore bcp/locals. If a caller has > // already saved them so that it can use esi/edi as temporaries > // then a save/restore here will DESTROY the copy the caller > // saved! There used to be a save_bcp() that only happened in > // the ASSERT path (no restore_bcp). Which caused bizarre failures > // when jvm built with ASSERTs. 25d30 < save_bcp(); 36,49c41,44 < #ifdef ASSERT < { Label L; < cmpl(esi, Address(ebp, frame::interpreter_frame_bcx_offset * wordSize)); < jcc(Assembler::equal, L); < stop("InterpreterMacroAssembler::call_VM_leaf_base: esi not callee saved?"); < bind(L); < } < { Label L; < cmpl(edi, Address(ebp, frame::interpreter_frame_locals_offset * wordSize)); < jcc(Assembler::equal, L); < stop("InterpreterMacroAssembler::call_VM_leaf_base: edi not callee saved?"); < bind(L); < } < #endif --- > > // Used to ASSERT that esi/edi were equal to frame's bcp/locals > // but since they may not have been saved (and we don't want to > // save them here (see note above) the assert is invalid.
03-11-2006