Corretto JDK 21 Build 35崩溃咨询:诊断与Bug上报建议
问题
- 您是否遇到过如下错误?
- 关于该问题的诊断,您有哪些思路或建议?
- 若这是JDK Bug,最佳上报渠道是什么?
环境信息
- Corretto JDK 21 Build 35(也曾尝试Zulu JDK 21 Build 35)
- GitHub Actions CI - Ubuntu 22.04.3 LTS
- Gradle 8.4 RC1
崩溃详情
Java运行时触发如下致命错误并崩溃:
# # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f58e7c40016, pid=3580, tid=3599 # # JRE version: OpenJDK Runtime Environment Corretto-21.0.0.35.1 (21.0+35) (build 21+35-LTS) # Java VM: OpenJDK 64-Bit Server VM Corretto-21.0.0.35.1 (21+35-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x840016] G1ParCopyClosure<(G1Barrier)0, false>::do_oop(oopDesc**)+0x56 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/runner/work/cas/cas/support/cas-server-support-ldap-core/core.3580) # # An error report file with more information is saved as: # /home/runner/work/cas/cas/support/cas-server-support-ldap-core/hs_err_pid3580.log # # If you would like to submit a bug report, please visit: # https://github.com/corretto/corretto-21/issues/ # # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00007f0044440016, pid=3611, tid=3615 # # JRE version: OpenJDK Runtime Environment Corretto-21.0.0.35.1 (21.0+35) (build 21+35-LTS) # Java VM: OpenJDK 64-Bit Server VM Corretto-21.0.0.35.1 (21+35-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x840016] G1ParCopyClosure<(G1Barrier)0, false>::do_oop(oopDesc**)+0x56 # # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/runner/work/cas/cas/support/cas-server-support-ldap/core.3611) # # An error report file with more information is saved as: # /home/runner/work/cas/cas/support/cas-server-support-ldap/hs_err_pid3611.log # # If you would like to submit a bug report, please visit: # https://github.com/corretto/corretto-21/issues/
解答
1. 是否遇到过该错误
这类G1 GC阶段触发的SIGSEGV错误在JDK 21早期Build版本中并不少见,尤其是G1ParCopyClosure相关的对象复制崩溃,不少用户在GitHub Actions这类CI环境中反馈过相同问题。
2. 诊断思路与建议
- 分析错误日志:优先查看生成的
hs_err_pid*.log文件,重点关注崩溃线程的调用栈、GC历史记录、内存分布情况,确认是否是GC复制对象时的非法内存访问。 - 升级JDK版本:Corretto和Zulu的JDK 21后续小版本(比如Build 40及以上)大概率修复了这类G1 GC的已知bug,直接更换为最新稳定版测试。
- 调整GC参数:临时切换GC收集器(比如改用ZGC或Shenandoah),或者禁用压缩指针参数
-XX:-UseCompressedOops(仅用于验证问题,不建议长期生产使用),看是否能规避崩溃。 - 排查CI资源:GitHub Actions的Ubuntu Runner默认内存有限,G1 GC在内存紧张时容易触发异常,尝试调整CI的内存分配参数,增加可用内存。
- 检查本地代码:如果项目中存在JNI调用或Unsafe API操作,排查是否有非法内存访问,但从错误栈来看,更倾向于JVM本身的问题。
3. JDK Bug上报渠道
如果确认是JDK Bug,优先选择对应发行版的官方渠道:
- 对于Corretto JDK,直接在Corretto 21的GitHub Issues页面提交,附上完整的
hs_err_pid*.log、环境信息、可复现的步骤。 - 若使用Zulu JDK,提交到Azul的官方Bug跟踪系统,或者对应的GitHub仓库。
内容的提问来源于stack exchange,提问作者Misagh Moayyed
相关产品推荐
相关产品推荐

