First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 57477
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: rob holland (RETIRED) <tigger@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
tail.patch fix lseek on fifo bug patch rob holland (RETIRED) 2004-07-18 06:34 0000 390 bytes Details | Diff
tail.patch improved patch for tail patch rob holland (RETIRED) 2004-07-19 09:16 0000 4.87 KB Details | Diff
coreutils.tail.patch patch to fix tail patch rob holland (RETIRED) 2005-01-07 02:05 0000 22.60 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 57477 depends on: Show dependency tree
Bug 57477 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-07-18 06:34 0000
This small patch fixes tail -f to not do an lseek if the input is a fifo.

For example:

rob@localhost rob $ mkfifo /tmp/test.fifo
rob@localhost rob $ tail -f /tmp/test.fifo &
rob@localhost rob $ echo bah >> /tmp/test.fifo
bah
tail: /tmp/test.fifo: file truncated
tail: /tmp/test.fifo: cannot seek to offset 0: Illegal seek

The patch has been sent upstream but it would be nice if this could be patched in the ebuild until it has been accepted by the coreutils maintainers.

------- Comment #1 From rob holland (RETIRED) 2004-07-18 06:34:59 0000 -------
Created an attachment (id=35692) [details]
fix lseek on fifo bug

------- Comment #2 From rob holland (RETIRED) 2004-07-19 01:26:07 0000 -------
Please hold off on this for a bit. This patch causes high cpu usage. I'll work
on a better fix.

------- Comment #3 From rob holland (RETIRED) 2004-07-19 09:16:42 0000 -------
Created an attachment (id=35751) [details]
improved patch for tail

This fixes the CPU issues with the former patch.

FIFOs are no longer stat'd in the tail_forever loop.

If data is read from one or more FIFOs during a tail_forever loop then all
FIFOs are skipped the next time around the loop. This prevents the case where
two FIFOs had opposite read_eof flags causing tail to loop forever checking and
flipping the flags without sleeping.

------- Comment #4 From rob holland (RETIRED) 2004-07-24 07:11:20 0000 -------
upstream have commited a patch that fixes this problem.

------- Comment #5 From rob holland (RETIRED) 2005-01-07 02:05:05 0000 -------
upstream still haven't released the flippin thing though.

"ported" patch to sys-apps/coreutils is attached.

Please commit.

You can test by merging the -r4 ebuild and trying:

echo foo | tail -f

It should not die with an illegal seek error message.

------- Comment #6 From rob holland (RETIRED) 2005-01-07 02:05:43 0000 -------
Created an attachment (id=47820) [details]
patch to fix tail

------- Comment #7 From SpanKY 2005-01-07 21:26:50 0000 -------
will be fixed in 5.2.1-r4, thanks

First Last Prev Next    No search results available      Search page      Enter new bug