[Bug 700958] Re: tail -f gives misleading error message when inotify limit is reached
Asif
vadud3 at gmail.com
Mon Aug 8 23:14:34 UTC 2011
I am having the exact same issue.
strace tail -f file
execve("/usr/bin/tail", ["tail", "-f", "file"], [/* 39 vars */]) = 0
brk(0) = 0xa1a000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0db215e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=135434, ...}) = 0
mmap(NULL, 135434, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0db213c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\360\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1638120, ...}) = 0
mmap(NULL, 3749080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0db1bac000
mprotect(0x7f0db1d36000, 2093056, PROT_NONE) = 0
mmap(0x7f0db1f35000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x189000) = 0x7f0db1f35000
mmap(0x7f0db1f3a000, 21720, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0db1f3a000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0db213b000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0db2139000
arch_prctl(ARCH_SET_FS, 0x7f0db2139720) = 0
mprotect(0x7f0db1f35000, 16384, PROT_READ) = 0
mprotect(0x60c000, 4096, PROT_READ) = 0
mprotect(0x7f0db2160000, 4096, PROT_READ) = 0
munmap(0x7f0db213c000, 135434) = 0
brk(0) = 0xa1a000
brk(0xa3b000) = 0xa3b000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=6856112, ...}) = 0
mmap(NULL, 6856112, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0db1522000
close(3) = 0
open("file", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
lseek(3, 0, SEEK_END) = 15
lseek(3, 0, SEEK_SET) = 0
read(3, "this is a file\n", 15) = 15
lseek(3, 0, SEEK_SET) = 0
read(3, "this is a file\n", 15) = 15
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0db215d000
write(1, "this is a file\n", 15this is a file
) = 15
fstat(3, {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
fstatfs(3, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=178230698, f_bfree=96244884, f_bavail=87191291, f_files=45268992, f_ffree=44592588, f_fsid={-449494421, -1492475350}, f_namelen=255, f_frsize=4096}) = 0
inotify_init() = 4
inotify_add_watch(4, "file", IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = -1 ENOSPC (No space left on device)
open("/usr/share/locale/locale.alias", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0db215c000
read(5, "# Locale name alias data base.\n#"..., 4096) = 2570
read(5, "", 4096) = 0
close(5) = 0
munmap(0x7f0db215c000, 4096) = 0
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=619, ...}) = 0
mmap(NULL, 619, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f0db215c000
close(5) = 0
write(2, "tail: ", 6tail: ) = 6
write(2, "cannot watch `file'", 19cannot watch `file') = 19
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No space left on device", 25: No space left on device) = 25
write(2, "\n", 1
) = 1
close(1) = 0
munmap(0x7f0db215d000, 4096) = 0
close(2) = 0
exit_group(1) = ?
iqbala at ghar-iqbala:~$ uname -a
Linux ghar-iqbala 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
iqbala at ghar-iqbala:~$ lsb_release -a
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/700958
Title:
tail -f gives misleading error message when inotify limit is reached
Status in The Gnu Core Utilities:
New
Status in “coreutils” package in Ubuntu:
Triaged
Bug description:
Binary package hint: coreutils
When tail -f has inotify enabled and hits the max_user_watches limit
of inotify, the resulting error message is very misleading.
To reproduce:
1) Make sure you will hit the limit if you try another inotify request
sudo sh -c 'echo 10 > /proc/sys/fs/inotify/max_user_watches'
2) Create a file:
touch /tmp/hello
3) Follow it:
tail -f /tmp/hello
Result:
tail: cannot watch `/tmp/hello': No space left on device
Expected result:
tail: cannot watch '/tmp/hello' because inotify reported: No space left on device
It can be verified by using strace tail -f /tmp/hello:
inotify_add_watch(4, "/tmp/hello", IN_MODIFY|IN_ATTRIB|IN_DELETE_SELF|IN_MOVE_SELF) = -1 ENOSPC (No space left on device)
---
Architecture: amd64
CheckboxSubmission: c61c47905a08381ec5d89e05cd06d034
CheckboxSystem: d00f84de8a555815fa1c4660280da308
DistroRelease: Ubuntu 10.10
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
NonfreeKernelModules: nvidia
Package: coreutils 8.5-1ubuntu3
PackageArchitecture: amd64
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.35-24.42-generic 2.6.35.8
Tags: maverick
Uname: Linux 2.6.35-24-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
To manage notifications about this bug go to:
https://bugs.launchpad.net/coreutils/+bug/700958/+subscriptions
More information about the foundations-bugs
mailing list