Project

General

Profile

Bug #5703

df returns no results in some situations

Added by Justin Cormack over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Base libraries
Target version:
Start date:
06/10/2016
Due date:
% Done:

100%

Estimated time:
Affected versions:
Security IDs:

Description

I am running Alpine 3.4 in a container and df returns no lines of output other than the header, but returns a zero return code:

moby:~# docker run alpine df
Filesystem 1K-blocks Used Available Use% Mounted on

busybox or Debian are fine. The only odd thing about this container is it has a very long first line for /proc/mounts:

docker run alpine cat /proc/mounts
overlay / overlay rw,relatime,lowerdir=/var/lib/docker/overlay/679fa932029d07180dc9f22198f5462375bcd5e23e83a58105f72cc8a7bbde30/root,upperdir=/var/lib/docker/overlay/700ad8e3d622803dd63f20613d9cc3404cacd3d42badedbc0426e61cbd79001b/upper,workdir=/var/lib/docker/overlay/700ad8e3d622803dd63f20613d9cc3404cacd3d42badedbc0426e61cbd79001b/work 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,relatime,mode=755 0 0
openrc /sys/fs/cgroup/openrc cgroup ro,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
cpuset /sys/fs/cgroup/cpuset cgroup ro,nosuid,nodev,noexec,relatime,cpuset 0 0
cpu /sys/fs/cgroup/cpu cgroup ro,nosuid,nodev,noexec,relatime,cpu 0 0
cpuacct /sys/fs/cgroup/cpuacct cgroup ro,nosuid,nodev,noexec,relatime,cpuacct 0 0
blkio /sys/fs/cgroup/blkio cgroup ro,nosuid,nodev,noexec,relatime,blkio 0 0
memory /sys/fs/cgroup/memory cgroup ro,nosuid,nodev,noexec,relatime,memory 0 0
devices /sys/fs/cgroup/devices cgroup ro,nosuid,nodev,noexec,relatime,devices 0 0
freezer /sys/fs/cgroup/freezer cgroup ro,nosuid,nodev,noexec,relatime,freezer 0 0
net_cls /sys/fs/cgroup/net_cls cgroup ro,nosuid,nodev,noexec,relatime,net_cls 0 0
perf_event /sys/fs/cgroup/perf_event cgroup ro,nosuid,nodev,noexec,relatime,perf_event 0 0
net_prio /sys/fs/cgroup/net_prio cgroup ro,nosuid,nodev,noexec,relatime,net_prio 0 0
hugetlb /sys/fs/cgroup/hugetlb cgroup ro,nosuid,nodev,noexec,relatime,hugetlb 0 0
pids /sys/fs/cgroup/pids cgroup ro,nosuid,nodev,noexec,relatime,pids 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
/dev/vda2 /etc/resolv.conf ext4 rw,relatime,data=ordered 0 0
/dev/vda2 /etc/hostname ext4 rw,relatime,data=ordered 0 0
/dev/vda2 /etc/hosts ext4 rw,relatime,data=ordered 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /proc/kcore tmpfs rw,nosuid,mode=755 0 0

Perhaps the long line causes a parse issue?

Associated revisions

Revision 6a2b1e8b (diff)
Added by Natanael Copa over 2 years ago

main/musl: fix for getmntent

ref #5703

Revision ae8d3cf9 (diff)
Added by Natanael Copa over 2 years ago

main/musl: fix for getmntent

fixes #5703

History

#1 Updated by Natanael Copa over 2 years ago

  • Priority changed from Normal to High
  • Target version set to 3.4.4

#2 Updated by Natanael Copa over 2 years ago

Justin Cormack wrote:

Perhaps the long line causes a parse issue?

Looks very much like that yes:

/ # strace df
execve("/bin/df", ["df"], [/* 6 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x7f4be9e24c48) = 0
set_tid_address(0x7f4be9e24c80)         = 27
mprotect(0x7f4be9e21000, 4096, PROT_READ) = 0
mprotect(0x563f8772e000, 16384, PROT_READ) = 0
getuid()                                = 0
ioctl(1, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=0, ws_ypixel=0}) = 0
writev(1, [{iov_base="Filesystem           1K-blocks  "..., iov_len=55}, {iov_base=" Mounted on\n", iov_len=12}], 2Filesystem           1K-blocks      Used Available Use% Mounted on
) = 67
open("/proc/mounts", O_RDONLY)          = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="overlay / overlay rw,relatime,lo"..., iov_len=1024}], 2) = 1024
lseek(3, -681, SEEK_CUR)                = 343
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++
/ # 

#3 Updated by Natanael Copa over 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Natanael Copa over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF