JDK-8306111 : PPC64: RT call after thaw with exception requires larger ABI section
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2023-04-17
  • Updated: 2023-05-23
  • Resolved: 2023-04-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 21
21 b19Fixed
Related Reports
Relates :  
Description
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

Comments
Changeset: 42b7260e Author: Richard Reingruber <rrich@openjdk.org> Date: 2023-04-19 07:18:26 +0000 URL: https://git.openjdk.org/jdk/commit/42b7260e8be02de78d82c6a4601519b9895826e9
19-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13505 Date: 2023-04-18 07:54:29 +0000
18-04-2023

ILW = possible overwrite of live data; ppc64 and virtual threads; no workaround = MMH = P3
17-04-2023