mmap - 取消引用范围内的指针时出现SIGBUS错误

时间:2016-09-11 07:46:33

标签: c linux unix mmap

我有一个程序试图从映射文件(共享库)中读取内容(0x7ffff5ebda78处的8个字节),并在读取时接收SIGBUS

映射文件的内存范围是:

7ffff5d81000-7ffff5f80000 r--s 00017000 fd:00 15209579 <file.so>

从此地址0x7ffff5ebda78读取会导致SIGBUS错误。

根据mmap文件:

SIGBUS Attempted  access to a portion of the buffer that does not correspond to the file (for example, beyond the end of the file,
          including the case where another process has truncated the file).

但是这似乎不是我访问超出文件末尾的缓冲区的情况。有什么想法吗?

0 个答案:

没有答案