You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenJDK 11.0.19中JVM执行HLT指令触发SIGSEGV崩溃原因咨询

OpenJDK 11.0.19 GregorianCalendar.computeTime() 崩溃问题

经测试发现OpenJDK 11.0.19存在一处bug,偶尔会导致java.util.GregorianCalendar.computeTime()方法触发崩溃。

更新记录

最终更新

感谢@apangin的提示,我了解到Linux内核发送的是SIGSEGV信号,而非我之前预期的SIGILL,相关逻辑可参考Linux内核traps.c函数的最后一行处理逻辑。

更新

回退到OpenJDK 11.0.18版本后,崩溃问题消失,但我仍有疑问:HLT指令为何会触发段错误(Segmentation Violation)?

操作系统环境

Red Hat Enterprise Linux release 8.7 (Ootpa) 4.18.0-425.19.2.el8_7.x86_64

崩溃日志信息

# JRE version: OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7) (build 11.0.19+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7-LTS, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# J 7581 c2 java.util.GregorianCalendar.computeTime()V java.base@11.0.19 (970 bytes) @ 0x00007ff72826feeb [0x00007ff72826f440+0x0000000000000aab]
Stack: [0x00007ff73ec47000,0x00007ff73ed48000],  sp=0x00007ff73ed44ad0,  free space=1014k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
J 7581 c2 java.util.GregorianCalendar.computeTime()V java.base@11.0.19 (970 bytes) @ 0x00007ff72826feeb [0x00007ff72826f440+0x0000000000000aab]
siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000
Registers:
RAX=0x0000000000000000, RBX=0x00000000e5b5f858, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x00007ff73ed44ad0, RBP=0x0000000000000000, RSI=0x00007ff73ed441d1, RDI=0x00007ff738023820
R8 =0x0000000000000000, R9 =0x00007ff73ed44150, R10=0x00000000000007cf, R11=0x0000000000000000
R12=0x0000000000000000, R13=0x0000000000001896, R14=0x00007ff6cda239e0, R15=0x00007ff738028800
RIP=0x00007ff72826feeb, EFLAGS=0x0000000000010246, CSGSFS=0x002b000000000033, ERR=0x0000000000000000
  TRAPNO=0x000000000000000d
Instructions: (pc=0x00007ff72826feeb)
...
0x00007ff72826febb:   08 4c 8b 6c 24 18 4c 8b c0 e9 a1 f7 ff ff be 7e
0x00007ff72826fecb:   ff ff ff 48 8b 6c 24 08 e8 28 1f 1a f8 48 bf 98
0x00007ff72826fedb:   4b bd 3d f7 7f 00 00 48 83 e4 f0 e8 25 e0 48 15
0x00007ff72826feeb:   f4 be f4 ff ff ff 48 89 1c 24 48 89 44 24 f8 8b
0x00007ff72826fefb:   44 24 10 89 44 24 08 48 8b 44 24 f8 4c 89 6c 24
0x00007ff72826ff0b:   10 66 66 90 e8 ec 1e 1a f8 be e4 ff ff ff 48 8b
0x00007ff72826ff1b:   6c 24 08 44 89 54 24 04 e8 d8 1e 1a f8 be e4 ff
0x00007ff72826ff2b:   ff ff 49 8b eb 89 5c 24 04 66 66 90 e8 c4 1e 1a
...

PC/RIP指向的地址包含HLT指令(0xF4):

e8 28 1f 1a f8          call   0xfffffffff81a1f45
48 bf 98 4b bd 3d f7    movabs rdi,0x7ff73dbd4b98
7f 00 00
48 83 e4 f0             and    rsp,0xfffffffffffffff0
e8 25 e0 48 15          call   0x1548e055
f4                      hlt
be f4 ff ff ff          mov    esi,0xfffffff4
48 89 1c 24             mov    QWORD PTR [rsp],rbx
48 89 44 24 f8          mov    QWORD PTR [rsp-0x8],rax

我想咨询:HLT指令为何会触发段错误?我已搜索数小时但未找到类似案例。


内容的提问来源于stack exchange,提问作者kingofworms

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 18:58:08