Dan Nicolaescu <address@hidden> wrote:
> address@hidden (Bob Proulx) writes:
>
> > Dan Nicolaescu wrote:
> > > Paul Eggert writes:
> > > > bash -c '(while echo foo; do :; done); echo status=$? >&2' | head
> > > >
> > > > If it eventually outputs "write error: Broken pipe", you have
> SIGPIPE
> > > > trapped, and that would explain your problem (which you need to
> track
> > > > down). If it prints "status=141" you do not have SIGPIPE trapped
> and
> > > > we need to investigate the issue further.
> > >
> > > The output is "write error: Broken pipe".
> >
> > Then that is a pretty strong indication that your session is trapping
> > SIGPIPE. You will have to debug that to root cause. Something,
> > somewhere in the start path for you is trapping that and it will cause
> > endless problems until it is found and fixed.
>
> Advice on finding that would be welcome.
As I suggested earlier, you need to find the shell code
(probably bourne shell code) that your window manager is running
before it exec's xterm. You'll probably find a trap stmt there.
> > > If I execute the same thing in a Linux console it never stops.
> >
> > Do you mean that on the console that you do not get that error and
> > everything seems to be working properly? That is what we would expect
> > and should be the normal behavior in your other terminals too, but
> > apparently is not.
>
> Please ignore my statement above, I made a typo on the command line.
>
> I run a few more experiments with the bash command above:
>
> - when run from an xterm it fails with the broken pipe error
>
> - when run from in an xterm like this:
> bash
> tcsh
> bash -c '(while echo foo; do :; done); echo status=$? >&2' | head
> it prints 141.
>
> - when run from the Linux console it fails with the broken pipe
> error. In that case the pstree chain is like this: init - login - tcsh
That's the way it should be.
So your login shell is clean,
but window-manager-spawned tools get the bad environment.
You haven't said what window manager you're using, but each one
usually comes with plenty of start-up scripts (usually under /etc).
Search those for the trap.