[riscv-port] RFR: 8279664: riscv: JFR crashes at 0x0

Fei Yang fyang at openjdk.java.net
Fri Jan 21 03:07:19 UTC 2022


On Thu, 20 Jan 2022 15:02:20 GMT, Xiaolin Zheng <xlinzheng at openjdk.org> wrote:

> Hi team,
> 
> This is a preview fix for the JFR-related crash - maybe the comment in this patch should be polished.
> TIL that complex problems often result from seemingly negligible changes :-)
> I need to cautiously test this change, though it seems no harm, to guarantee that it is safe and to ensure the problem is gone so please stay a little tuned.
> 
> ----
> Update:
> 
> 1. Overnight JFR testing reveals no error, seems fixed.
> 2. `test/hotspot/jtreg` on the board reveals no error until now - still testing, but I think it is safe.
> ----
> 
> Thanks,
> Xiaolin

Great catch. This aligns with function "enter()" which creates stack frames. Looks good.

src/hotspot/cpu/riscv/macroAssembler_riscv.hpp line 63:

> 61: 
> 62:   void leave() {
> 63:     // Note: setting sp above the address of alive variables could result in undefined behaviors:

I would suggest move this code comment before function "void enter()" in the same file.
Maybe rephrasing like this:
"SP must be updated to the right place before saving/restoring RA and FP because signal
 based thread suspend/resume could happen asynchronously."

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

Changes requested by fyang (Lead).

PR: https://git.openjdk.java.net/riscv-port/pull/49


More information about the riscv-port-dev mailing list