Bug #15780
closedApplications using kernel based cephfs and mmap fail with SIGBUS if debugger is attached with strace
0%
Description
OS/Kernel: Ubuntu Trusty with Xenial LTS backport kernel 4.4.0-21-generic
Ceph: 0.94.6
The PTRACE_ATTACH syscall used by strace and gdb may interrupt the cephfs mmap handler, resulting in a SIGBUS for the application.
See e.g. https://github.com/torvalds/linux/blob/master/fs/ceph/addr.c#L1342
Steps to reproduce:
1. have a rather slow ceph cluster (higher chance to hit the mmap handler)
2. flush all caches (echo 3 > /proc/sys/vm/drop_caches)
3. run an application making heavy used of mmap'ed memory
4. try to attach a debugger or strace with the right timing
Expected result:
- debugger prompt or strace output
Got result:
application:
Bus error (core dumped)
strace:
~# strace p 60724 SIGBUS {si_signo=SIGBUS, si_code=BUS_ADRERR, si_addr=0x7fbda9063c1c} ---
Process 60724 attached
--
++ killed by SIGBUS (core dumped) ++
The mmap handler in the code referred to above returns SIGBUS on several occasions. It is unclear whether the SIGBUS originates from line 1342, 1366 or 1382. Is it possible to activate debug output implemented with dout(..) on a running kernel, which may allow to rule out the first occurrence?
Updated by Zheng Yan almost 8 years ago
- Project changed from CephFS to Linux kernel client
- Category deleted (
53) - Status changed from New to 7
- Priority changed from Low to Normal