RFR: 8266749: AArch64: Backtracing broken on PAC enabled systems [v3]

Andrew Haley aph at openjdk.java.net
Thu May 27 12:52:15 UTC 2021


On Thu, 27 May 2021 10:26:27 GMT, Alan Hayward <github.com+4146708+a74nh at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/frame_aarch64.cpp line 516:
>> 
>>> 514:   // to the stack. In addition, we do not know which key was used to sign it.
>>> 515:   // Therefore, all we can do is strip it.
>>> 516:   address sender_pc = pauth_strip_pointer(this->sender_pc());
>> 
>> Would it not make more sense to strip the `sender_pc()` ? Don't all users expect it to be stripped?
>
>> Would it not make more sense to strip the `sender_pc()` ? Don't all users expect it to be stripped?
> 
> The current code is being fairly cautious:
> 
> Native frames: saved PC might be signed. Therefore strip the pc.
> 
> Interpreter frames and compiled frames: the PC should never be signed. Assert this is the case.
> 
> For both Interpreter and Native frames we are getting the pc via sender_pc(), so can't push the strip inside sender_pc().
> 
> Alternatively, we could always strip instead of asserting. But that's not quite as nice.

Mmm, but you very easily fix that by defining `raw_sender_pc()`. Most users don't want to be bothered by this stuff, and having `sender_pc()` return an encrypted PC is, frankly, maintainer abuse. Anyone who wants the `raw_sender_pc()` should ask for it.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4029


More information about the hotspot-dev mailing list