【发布时间】:2022-08-22 22:14:22
【问题描述】:
在我正在处理的一些本机 M1 代码中,调用特定函数会引发毫无意义的 SIGBUS 错误:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000280dc7da0
Exception Codes: 0x0000000000000002, 0x0000000280dc7da0
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process: exc handler [12171]
VM Region Info: 0x280dc7da0 is in 0x280d50000-0x280dd0000; bytes after start: 490912 bytes before end: 33375
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE 280cf0000-280d50000 [ 384K] rw-/rwx SM=ZER
---> VM_ALLOCATE 280d50000-280dd0000 [ 512K] rwx/rwx SM=ZER
VM_ALLOCATE 280dd0000-280e50000 [ 512K] rw-/rwx SM=ZER
根据这个转储:
- 故障地址与功能地址相同。
- 函数地址 (0x280dc7da0) 正确对齐。
- 目标区域具有
rwx保护,因此是可执行的。
什么可能在这里触发 SIGBUS?
顺便说一句,这个程序的 Intel (x64) 版本在 x64 Mac 和 Rosetta 上运行良好。
标签: crash native apple-m1 apple-silicon sigbus