tail -f gives misleading error message when inotify limit is reached
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| coreutils |
Undecided
|
|||
| coreutils (Ubuntu) |
Low
|
Unassigned |
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/
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_
---
Architecture: amd64
CheckboxSubmission: c61c47905a08381
CheckboxSystem: d00f84de8a55581
DistroRelease: Ubuntu 10.10
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
NonfreeKernelMo
Package: coreutils 8.5-1ubuntu3
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
ProcVersionSign
Tags: maverick
Uname: Linux 2.6.35-24-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
A. Bram Neijt (bneijt) wrote : Dependencies.txt | #1 |
tags: | added: apport-collected |
description: | updated |
C de-Avillez (hggdh2) wrote : | #3 |
Thank you for opening this bug and helping make Ubuntu better -- and thank you also for the upstream bug reference, it does help.
On the upstream bug Jim states this was ficed on coreutils 8.6; it is possible this (or a newer) version will be available for Natty (current development release; I will check on what Debian currently has, and request a merge if needed.
Marking Triaged/Low.
Changed in coreutils (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Triaged |
Asif (vadud3) wrote : | #4 |
I am having the exact same issue.
strace tail -f file
execve(
brk(0) = 0xa1a000
access(
mmap(NULL, 8192, PROT_READ|
access(
open("/
fstat(3, {st_mode=
mmap(NULL, 135434, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0db213c000
close(3) = 0
access(
open("/
read(3, "\177ELF\
fstat(3, {st_mode=
mmap(NULL, 3749080, PROT_READ|
mprotect(
mmap(0x7f0db1f3
mmap(0x7f0db1f3
close(3) = 0
mmap(NULL, 4096, PROT_READ|
mmap(NULL, 8192, PROT_READ|
arch_prctl(
mprotect(
mprotect(0x60c000, 4096, PROT_READ) = 0
mprotect(
munmap(
brk(0) = 0xa1a000
brk(0xa3b000) = 0xa3b000
open("/
fstat(3, {st_mode=
mmap(NULL, 6856112, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0db1522000
close(3) = 0
open("file", O_RDONLY) = 3
fstat(3, {st_mode=
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=
mmap(NULL, 4096, PROT_READ|
write(1, "this is a file\n", 15this is a file
) = 15
fstat(3, {st_mode=
fstatfs(3, {f_type=
inotify_init() = 4
inotify_
open("/
fstat(5, {st_mode=
mmap(NULL, 4096,...
Christian Mertes (cmertes) wrote : | #5 |
Fixed in coreutils 8.6 as per upstream bug report.
A. Bram Neijt (bneijt) wrote : | #6 |
No problem in core-utils 8.13:
$ sudo sh -c 'echo 10 > /proc/sys/
$ touch /tmp/hello
$ tail -f /tmp/hello
tail: inotify resources exhausted
tail: inotify cannot be used, reverting to polling
Changed in coreutils (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in coreutils: | |
status: | New → Fix Released |
apport information