Integrated: 8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform

Gui Cao gcao at openjdk.org
Thu Dec 21 01:31:59 UTC 2023


On Thu, 14 Dec 2023 08:28:42 GMT, Gui Cao <gcao at openjdk.org> wrote:

> As described on the JBS issue, JDK-8320886 extended InternalErrorTest.java adding extra test for Unsafe_SetMemory0 trying to access next page after truncation. This triggers SIGBUS error and control flow is transfered to JVM signal handler [1]. But the current logic doesn't consider 16-bit compressed instructions when calculating next_pc. It always add NativeCall::instruction_size which is 4 to pc and use the result as next_pc. This is not correct as the memset invoked in this case contains compressed instructions and it is those instructions that are triggering the SIGBUS error.
> 
> The proposed fix is similar with other platform with variable-length instruction encoding like x86.
> The encoding of the instruction triggering the SIGBUS error is checked to see if it is a compressed instruction and then calculate next_pc based on that. The test case can now pass normally with this fix. 
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp#L274
> 
> ### Testing:
> - [x]  Run tier1-3 tests on qemu 8.1.50 with UseRVV (release)

This pull request has now been integrated.

Changeset: e8768ae0
Author:    Gui Cao <gcao at openjdk.org>
Committer: Fei Yang <fyang at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e8768ae08dbee9c3e1ed01934142c03ffad5f349
Stats:     13 lines in 2 files changed: 11 ins; 0 del; 2 mod

8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform

Co-authored-by: Fei Yang <fyang at openjdk.org>
Reviewed-by: fyang

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

PR: https://git.openjdk.org/jdk/pull/17103


More information about the hotspot-dev mailing list