RFR: 8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform
Gui Cao
gcao at openjdk.org
Thu Dec 14 08:37:01 UTC 2023
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:
- [ ] Run tier1-3 tests on qemu 8.1.50 with UseRVV (release)
-------------
Commit messages:
- 8321972: test runtime/Unsafe/InternalErrorTest.java timeout on linux-riscv64 platform
Changes: https://git.openjdk.org/jdk/pull/17103/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17103&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8321972
Stats: 13 lines in 2 files changed: 11 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/17103.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17103/head:pull/17103
PR: https://git.openjdk.org/jdk/pull/17103
More information about the hotspot-dev
mailing list