JDK-6997459 : JSR 292 after 6994093 getting: on return to interpreted call, restored SP is corrupted
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-11-04
  • Updated: 2012-02-01
  • Resolved: 2010-11-19
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
6u25Fixed 7Fixed hs20Fixed
Related Reports
Relates :  
Description
After 6994093 running a testcase on SPARC that should throw a WrongMethodTypeException like:

$ gamma -Xint -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp classes:. Test
VM option '+UseSerialGC'
VM option '+UnlockExperimentalVMOptions'
VM option '+EnableInvokeDynamic'
# ERROR: Caught exception java.dyn.InvokeDynamicBootstrapError: call site initialization exception in Thread[Thread-0,5,main]
java.dyn.InvokeDynamicBootstrapError: call site initialization exception
        at sun.dyn.CallSiteImpl.makeSite(CallSiteImpl.java:72)
        at sun.dyn.MethodHandleNatives.makeDynamicCallSite(MethodHandleNatives.java:310)
        at Test.runThread(Test.java:47)
        at vm.mlvm.share.MultiThreadedTest$1.run(MultiThreadedTest.java:32)
        at java.lang.Thread.run(Thread.java:729)
Caused by: java.dyn.WrongMethodTypeException: target(Test,java.lang.String,int)java.lang.Object should be of type (Test,java.lang.String,int)void
        at java.dyn.CallSite.wrongTargetType(CallSite.java:273)
        at java.dyn.CallSite.initializeFromJVM(CallSite.java:190)
        at sun.dyn.CallSiteImpl.makeSite(CallSiteImpl.java:62)
        ... 4 more

results in:

$ gamma -Xint -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp classes:. Test
VM option '+UseSerialGC'
VM option '+UnlockExperimentalVMOptions'
VM option '+EnableInvokeDynamic'
=============== DEBUG MESSAGE: on return to interpreted call, restored SP is corrupted ================

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/hotspot/rev/e62345fd6a46
04-12-2010

SUGGESTED FIX Change temporary register usage in MethodHandles::generate_method_handle_interpreter_entry to preserve O5.
04-11-2010

EVALUATION The problem is that the change of 6994093 destroys O5 which is the saved sender SP and that leads to bogus FP values.
04-11-2010

EVALUATION Running in the debugger shows that the framesize of the method handle call site (from frame 3 to frame 2) is very big. Although the stack is correct and removing the size check make the testcase work. (dbx) where current thread: t@10 [1] __lwp_kill(0x0, 0x6, 0x0, 0x6, 0xffbffeff, 0x0), at 0xfdb4d264 [2] raise(0x6, 0x0, 0xfdbb5028, 0xfdb2c9a8, 0xffffffff, 0x6), at 0xfdae64ec [3] abort(0xb70af9b8, 0x1, 0xff15e754, 0xee974, 0xfdbb3458, 0x0), at 0xfdac1b6c =>[4] os::abort(dump_core = true), line 1804 in "os_solaris.cpp" [5] VMError::report_and_die(this = 0xb70afb8c), line 907 in "vmError.cpp" [6] report_vm_error(file = 0xfec20e07 "/home/ct232829/hotspot-comp/6997459/src/cpu/sparc/vm/assembler_sparc.cpp", line = 1969, error_msg = 0xfec20e50 "assert(false) failed", detail_msg = 0xfec20e65 "error"), line 178 in "debug.cpp" [7] MacroAssembler::debug(msg = 0xfee3da6a "on return to interpreted call, restored SP is corrupted", regs = 0xb70afd08), line 1969 in "assembler_sparc.cpp" [8] 0xfb40069c(0xb70afd08, 0xfee3da6a, 0x0, 0xfb42a820, 0xb6, 0xfb4004c0), at 0xfb40069c [9] 0xfb411294(0xb70b07a0, 0xfb4067cc, 0x0, 0xfb42b080, 0xb66ff140, 0xb70aff10), at 0xfb411294 (dbx) p ps() "Executing ps" for thread: "Thread-0" prio=3 tid=0x0018dc00 nid=0xa runnable [0x00000000] java.lang.Thread.State: RUNNABLE JavaThread state: _thread_in_Java Thread: 0x0018dc00 [0x a] State: _running _has_called_back 0 _at_poll_safepoint 0 JavaThread state: _thread_in_Java (guessing starting frame id=b70af8b0 based on current fp) C frame (sp=0xb70af8b0 unextended sp=0xb70af8b0, fp=0xb70af940, pc=0xfdac1b74) C frame (sp=0xb70af940 unextended sp=0xb70af940, fp=0xb70af9f0, pc=0xfe8cbbd4) C frame (sp=0xb70af9f0 unextended sp=0xb70af9f0, fp=0xb70afb28, pc=0xfeb6e71c) C frame (sp=0xb70afb28 unextended sp=0xb70afb28, fp=0xb70afbd0, pc=0xfe33d458) C frame (sp=0xb70afbd0 unextended sp=0xb70afbd0, fp=0xb70afc48, pc=0xfdfbcdd0) C frame (sp=0xb70afc48 unextended sp=0xb70afc48, fp=0xb70afca8, pc=0xfb4006a4) (~Stub::stop_subroutine) BufferBlob (0xfb400108) used for StubRoutines (1) 1 - frame( sp=0xb70afca8, unextended_sp=0xb70afca8, fp=0xb70aff10, pc=0xfb41129c) java.dyn.CallSite.initializeFromJVM(CallSite.java:195) 2 - frame( sp=0xb70aff10, unextended_sp=0xb70aff10, fp=0xb66ff158, pc=0xfb411280) sun.dyn.CallSiteImpl.makeSite(CallSiteImpl.java:62)OpenJDK Server VM warning: SUSPICIOUSLY LARGE FRAME (-2540398) 3 - frame( sp=0xb66ff158, unextended_sp=0xb66ff168, fp=0xb66ff1f8, pc=0xfb406490) sun.dyn.MethodHandleNatives.makeDynamicCallSite(MethodHandleNatives.java:310) C frame (sp=0xb66ff1f8 unextended sp=0xb66ff1f8, fp=0xb66ff270, pc=0xfb4002f8) (~Stub::call_stub) BufferBlob (0xfb400108) used for StubRoutines (1) 4 - frame( sp=0xb66ff748, unextended_sp=0xb66ff748, fp=0xb66ff7c8, pc=0xfb42be58) Test.runThread(Test.java:47) 5 - frame( sp=0xb66ff7c8, unextended_sp=0xb66ff7d0, fp=0xb66ff850, pc=0xfb4062a4) vm.mlvm.share.MultiThreadedTest$1.run(MultiThreadedTest.java:32) 6 - frame( sp=0xb66ff850, unextended_sp=0xb66ff858, fp=0xb66ff8d0, pc=0xfb407364) java.lang.Thread.run(Thread.java:729) register window backtrace from 0xb70af8b0: [0] sp=0xb70af8b0 pc=0x00000000 is an unknown value [1] sp=0xb70af940 pc=0xfe8cbbcc: JVM_FindSignal+0x28d4f4 in /export/twisti/hotspot-comp/6997459/build/solaris_sparc_compiler2/jvmg/libjvm.so at 0xfdc00000 [2] sp=0xb70af9f0 pc=0xfeb6e714: JVM_handle_solaris_signal+0x28ee5c in /export/twisti/hotspot-comp/6997459/build/solaris_sparc_compiler2/jvmg/libjvm.so at 0xfdc00000 [3] sp=0xb70afb28 pc=0xfe33d450: +0x4eb9f0 in /export/twisti/hotspot-comp/6997459/build/solaris_sparc_compiler2/jvmg/libjvm.so at 0xfdc00000 [4] sp=0xb70afbd0 pc=0xfdfbcdc8: +0x16b368 in /export/twisti/hotspot-comp/6997459/build/solaris_sparc_compiler2/jvmg/libjvm.so at 0xfdc00000 [5] sp=0xb70afc48 pc=StubRoutines::stop_subroutine [0xfb4004c0, 0xfb4007e0[ (800 bytes) [6] sp=0xb70afca8 pc=0xfb411294 is an Interpreter codelet exception handling [0xfb411220, 0xfb411c80] 2656 bytes [7] sp=0xb70aff10 pc=0xfb411278 is an Interpreter codelet exception handling [0xfb411220, 0xfb411c80] 2656 bytes [8] sp=0xb66ff158 [bogus sp!]ps() = (void)
04-11-2010