Project

General

Profile

Actions

Bug #15780

closed

Applications using kernel based cephfs and mmap fail with SIGBUS if debugger is attached with strace

Added by Burkhard Linke almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
kcephfs
Crash signature (v1):
Crash signature (v2):

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
Process 60724 attached
--
SIGBUS {si_signo=SIGBUS, si_code=BUS_ADRERR, si_addr=0x7fbda9063c1c} ---
++ 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?

Actions #1

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
Actions #2

Updated by Loïc Dachary almost 8 years ago

  • Target version deleted (v0.94.7)
Actions #3

Updated by Zheng Yan almost 8 years ago

  • Status changed from 7 to Resolved
Actions

Also available in: Atom PDF