Re: Strange pager (less, more) behavior
- From: Dave Ulrick <ulrick@xxxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 02:17:00 +0000 (UTC)
On Thu, 30 Mar 2006 19:00:10 +0000 (UTC),
Dave Ulrick <ulrick@xxxxxxxxxxxxxxxx> wrote:
On Thu, 30 Mar 2006 09:53:01 -0800,
Steve Kirkendall <skirkendall@xxxxxxxxxxxx> wrote:
* Maybe some other process is running on your terminal in the background,
and interfering with "less". One way to find out is to run "tty" to
see which tty you're on, and then "fuser /dev/..." on that tty. You
should expect to see only the pids of the shell, ./mycat, and less.
I'll look into that. In fact, I'm starting to wonder if one of those
GNOME-ish things that ships with Fedora Core (a file monitor whose name I
can't recall) might be interfering with file allocations in a strange way.
The 2.6.5 system I've mentioned (that has no problem) is a SuSE 9.1 distro
instead of a FC2 distro, so it's free of GNOME stuff.
I've recreated my problem and run 'fuser /dev/pts/7'. Here's what
I get:
/dev/pts/7 ulrick 14117 f.... mycat
ulrick 14118 f.... less
ulrick 14138 f.... fuser
ulrick 26978 f.... bash
As for 'fam', it doesn't appear to be the culprit. I had it running
on one of the afflicted systems, but not the other, and the problem
recurred after I brought it down on the one system.
I've managed to figure out how to trace my complete pipeline using
strace. The key is the strace -f switch. First, I get the pid for
my bash shell by entering 'echo $$'. Then, I issue 'strace -o log -f
-p <pid>' in another window. Finally, I invoke my program with 'less'
in an infinite loop like so:
$ while true; do ./mycat *.c | less; done
I can exit the loop by quickly hitting Ctrl-C twice.
With this approach, all I have to do is hit 'q' over and over again
to exit 'less'. That's all great so far. The bad news: I haven't
been able to recreate my problem this way so far, so all I end up
with is a voluminous trace file of large numbers of successful
pipelines.
This is looking more and more like a timing or race condition, since
it seems that any change from invoking my program in a pipe with
a pager from a shell prompt alters the mix enough that the problem
doesn't occur. Even this command line circumvents the problem:
$ ./mycat *.c | (sleep .1; less)
The problem doesn't occur even when I use my 'while true' loop
without 'strace'.
Dave
--
Dave Ulrick
Email: d-ulrick@xxxxxxx
Web: http://www.niu.edu/~ulrick/
.
- References:
- Strange pager (less, more) behavior
- From: Dave Ulrick
- Re: Strange pager (less, more) behavior
- From: Dave Ulrick
- Re: Strange pager (less, more) behavior
- From: Steve Kirkendall
- Re: Strange pager (less, more) behavior
- From: Dave Ulrick
- Strange pager (less, more) behavior
- Prev by Date: Re: Strange pager (less, more) behavior
- Next by Date: Memory fault when i am using a shared object
- Previous by thread: Re: Strange pager (less, more) behavior
- Next by thread: Playback utility
- Index(es):