Debugging SIGBUS on x86 Linux

前端 未结 9 1351
生来不讨喜
生来不讨喜 2020-11-30 08:38

What can cause SIGBUS (bus error) on a generic x86 userland application in Linux? All of the discussion I\'ve been able to find online is regarding memory alignment errors,

9条回答
  •  孤街浪徒
    2020-11-30 09:32

    You can get a SIGBUS from an unaligned access if you turn on the unaligned access trap, but normally that's off on an x86. You can also get it from accessing a memory mapped device if there's an error of some kind.

    Your best bet is using a debugger to identify the faulting instruction (SIGBUS is synchronous), and trying to see what it was trying to do.

提交回复
热议问题