我有一个程序试图从映射文件(共享库)中读取内容(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).
但是这似乎不是我访问超出文件末尾的缓冲区的情况。有什么想法吗?