遇到的问题:
我在使用idea运行java服务的时候报出以下错误
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001039a63c8, pid=13662, tid=4355
#
# JRE version: OpenJDK Runtime Environment Microsoft-11367290 (11.0.27+6) (build 11.0.27+6-LTS)
# Java VM: OpenJDK 64-Bit Server VM Microsoft-11367290 (11.0.27+6-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# V [libjvm.dylib+0x67e3c8] AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<1097844ull, G1BarrierSet>, (AccessInternal::BarrierType)2, 1097844ull>::oop_access_barrier(void*)+0x8
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/aer/IdeaProjects/tjxt/hs_err_pid13662.log
#
# If you would like to submit a bug report, please visit:
# https://github.com/microsoft/openjdk/issues
#
这个问题我一共遇到了两次,今天是第二次 上一次我更换了jdk+重启糊里糊涂地不知道为什么就又能成功运行了,之后我就没管了(那时候我在测试循环依赖报错,恰巧就出现了这个jvm崩溃错误,我还以为是循环依赖导致的问题)。但是今天啥也没干一运行突然又出现了这个错误。拷打gpt后找到解决方法如下
解决方案
将Idea的启用定时调试器关掉
将这个关掉后就又能成功运行啦!
报错原因
根本原因是:JetBrains 的定时任务调试器(Scheduled Debug Agent)使用了不稳定的 native 代码,它和 JDK 的 G1 垃圾回收机制发生了冲突。
责任方 | 是否是主要原因 | 原因 |
---|---|---|
✅ JetBrains 的调试器(libscheduled.dylib ) |
是主要原因 | 它注入 native 代码,访问 JVM 内存结构,实现不稳定、适配差,在 macOS ARM 架构下触发崩溃 |
⚠️ JVM | 有一定关系 | G1 GC 的内部结构复杂,对外暴露接口不适合被 native 调用篡改,但它本身没错,除非是低版本才算 bug |