After thawing continuation frames the top frame has only got the minimal ABI of size `frame::metadata_words_at_top`. This is not sufficient for the runtime call of `SharedRuntime::exception_handler_for_return_address()` to forward an exception in or over the thawed frame.
Depending on the ELF ABI version (see `ABI_ELFv2`) there has to be an ABI section of 12 or 14 words for a call [2].
Below we see 2 frames with just 4 words == `frame::metadata_words_at_top`
ABI. The callee expects 12 or 14 words and might overwrite live data of the
caller.
Compiled Top Frame
==========================
0x00007ffff5a4da50: 0x00007ffff5a4daf0 #0 nmethod 0x00007fffe0726310 for method J BasicExt$Continuation3Frames.ord103_testMethod_dontinline(JJJLjava/lang/String;)Ljava/lang/String;
- #0 scope BasicExt$Continuation3Frames.ord103_testMethod_dontinline(JJJLjava/lang/String;)Ljava/lang/String; @ 7
unextended_sp for #1
sp for #1
0x00007ffff5a4da48: 0x00007fffdfe885f0
0x00007ffff5a4da40: 0x0000000000000185
0x00007ffff5a4da38: 0x00007fffd8ac0000
0x00007ffff5a4da30: 0x00007fffe07265ec return address
0x00007ffff5a4da28: 0x0000000028800282
0x00007ffff5a4da20: 0x00007ffff5a4da50 unextended_sp for #0
Interpreted Top Frame (should be viewed with monospace font)
==============================
0x00007ffff5a4d9f0: 0x00007ffff5a4daf0 #0 method BasicExt$Continuation3Frames.ord103_testMethod_dontinline(JJJLjava/lang/String;)Ljava/lang/String; @ 7
- 8 locals 9 max stack
- codelet: return entry points
sp for #1
0x00007ffff5a4d9e8: 0x00007fffb4724a90 fresult
0x00007ffff5a4d9e0: 0x00007ffff5a4d6f0 lresult
0x00007ffff5a4d9d8: 0x0000000000000000 oop_tmp
0x00007ffff5a4d9d0: 0x00007ffff5a4da50 sender_sp
0x00007ffff5a4d9c8: 0x00007ffff5a4d8e0 top_frame_sp
0x00007ffff5a4d9c0: 0x0000000000000000 mdx
0x00007ffff5a4d9b8:.0x00007ffff5a4d940.esp.-------+
0x00007ffff5a4d9b0:.0x00007fffb4707abf.bcp........|
0x00007ffff5a4d9a8:.0x00007fffb470e8e0.cpoolCache.|
0x00007ffff5a4d9a0:.0x00007ffff5a4d988.monitors...|
0x00007ffff5a4d998:.0x000000000000000b.locals.....|
0x00007ffff5a4d990:.0x00000000ffc5ec80.mirror.....|
.......................................oop.for.#0.|
0x00007ffff5a4d988:.0x00007fffb4707b10.method.....|
0x00007ffff5a4d980:.0x00000000ffc60650............|
0x00007ffff5a4d978:.0x0000000000000000............|
0x00007ffff5a4d970:.0x0000000000000001............|
0x00007ffff5a4d968:.0x0000000000000000............|
0x00007ffff5a4d960:.0x0000000000000002............|
0x00007ffff5a4d958:.0x0000000000000000............|
0x00007ffff5a4d950:.0x0000000000000003............|
0x00007ffff5a4d948:.0x00000000ffb017d8............|
0x00007ffff5a4d940:.0x00007ffff0019250.<----------+
0x00007ffff5a4d938: 0x0000000000000003
0x00007ffff5a4d930: 0x00007fffdfe88234 return address
0x00007ffff5a4d928: 0x00000000bbaaddf9
0x00007ffff5a4d920: 0x00007ffff5a4d9f0 unextended_sp for #0
sp for #0
[1] frame::java_abi
[2] ELF ABI v2: 2.2.2. The Stack Frame: https://openpowerfoundation.org/specifications/64bitelfabi/
ELF ABI v1.9: https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#STACK