JDK-8319747 : galoisCounterMode_AESCrypt stack walking broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-11-08
  • Updated: 2023-11-21
  • Resolved: 2023-11-16
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 22
22 masterFixed
Related Reports
Relates :  
Description
The (x64) Java stack walking code uses RBP as a stack pointer; the register points to the location of previous RBP, and the next slot on stack is supposed to contain the return address at all times.

The stub mentioned in the summary changes RBP in the middle of the method [1]. This breaks stack walking, resulting in odd flamegraphs generated by asyncprofiler.

Sample flamegraphs (current and fixed) attached. They were produced with:
make test TEST=micro:full.CipherBench.GCM.enc MICRO_OPTIONS='-prof async:libPath=/path/to/libasyncProfiler.so\\\;output=flamegraph'

[1] https://github.com/openjdk/jdk/blob/17409500369bd8503782b2e6f4e885e33837087a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp#L264-L265
Comments
Changeset: faeea07f Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2023-11-16 08:55:18 +0000 URL: https://git.openjdk.org/jdk/commit/faeea07fe5d27e0c18c26f99705cc552e5ab9bdc
16-11-2023

ILW = Intrinsic breaks stack walking, AES Galois CounterMode intrinsic during stack walking, disable intrinsic = MLH = P4
09-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16567 Date: 2023-11-08 18:11:58 +0000
08-11-2023