Discussion:
[Bug gdb/23613] New: gdb segfaults when in an unreachable directory
jcsible at cert dot org
2018-09-06 12:29:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23613

Bug ID: 23613
Summary: gdb segfaults when in an unreachable directory
Product: gdb
Version: HEAD
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: jcsible at cert dot org
Target Milestone: ---

When gdb is ran in a directory that's unreachable (specifically, when the
getcwd system call gives a string beginning with "(unreachable)"), it will
segfault. Reproduction steps:

sudo mount -t tmpfs none /mnt
cd /mnt
sudo umount --lazy /mnt
gdb /bin/true
run

I've tested this with multiple versions of gdb:

On 8.2.50.20180906-git (commit d82b386, which is HEAD as of this writing) on
RHEL 7.5, it crashes before I even get to the prompt to type "run". On
8.1-0ubuntu3 on Ubuntu 18.04, it gets to the prompt, then crashes after I type
"run". On 7.6.1-110.el7 on RHEL 7.5, the crash doesn't seem to happen at all.

(The actual case I hit this in involved directories from foreign mount
namespaces accessed via the /proc/*/fd/ symlinks rather than lazy unmounts, but
this test case is simpler and exposes the exact same problem.)
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...