Debugging SIGBUS on x86 Linux

前端 未结 9 1341
生来不讨喜
生来不讨喜 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:38

    If you request a mapping backed by hugepages with mmap and the MAP_HUGETLB flag, you can get SIGBUS if the kernel runs out of allocated huge pages and thus cannot handle a page fault.

    In this case, you'll need to raise the number of allocated huge pages via

    • /sys/kernel/mm/hugepages/hugepages-/nr_hugepages or
    • /sys/devices/system/node/nodeX/hugepages/hugepages-/nr_hugepages on NUMA systems.

提交回复
热议问题