All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Interesting race condition...
Date: Tue, 27 Jul 2004 16:40:22 -0400	[thread overview]
Message-ID: <ce6e3r$i4n$1@gatekeeper.tmr.com> (raw)
In-Reply-To: <200407240317.57032.rob@landley.net>

Rob Landley wrote:
> On Friday 23 July 2004 05:01, P. Benie wrote:
> 
>>On Fri, 23 Jul 2004, Rob Landley wrote:
>>
>>>I just saw a funky thing.  Here's the cut and past from the xterm...
>>>
>>>[root@(none) root]# ps ax | grep hack
>>> 9964 pts/1    R      0:00 grep hack HOSTNAME= SHELL=/bin/bash TERM=xterm
>>>HISTSIZE=1000 USER=root
>>>LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=
>>>40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.
>>>com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz
>>>= [root@(none) root]# ps ax | grep hack
>>> 9966 pts/1    S      0:00 grep hack
>>>
>>>Seems like some kind of race condition, dunno if it's in Fedore Core 1's
>>>ps or the 2.6.7 kernel or what...
>>
>>The race is in the shell's pipeline - the processes don't start at exactly
>>the same time, and sometimes ps has completed before the shell has
>>started grep. This is the expected behaviour.
> 
> 
> It's expected behavior for PS to show a process's environment variables as 
> part of its command line?

When piped. For instance
   ps eaxf
does not, while
   ps eaxf | cat
does, at least on my systems. I tried on RHEL AS3.0 thru a four year old 
version of Slackware, all did the same thing.


-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me

  parent reply	other threads:[~2004-07-27 20:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-23  3:04 Interesting race condition Rob Landley
2004-07-23  7:33 ` Barry K. Nathan
2004-07-23  7:56   ` Hugo Mills
2004-07-24  8:13   ` Rob Landley
2004-07-24 13:40     ` Marc Ballarin
2004-07-26 16:04       ` David Weinehall
2004-07-26 17:20       ` Marc Ballarin
2004-07-23 10:01 ` P. Benie
2004-07-24  8:17   ` Rob Landley
2004-07-24  9:08     ` P. Benie
2004-07-27 20:40     ` Bill Davidsen [this message]
2004-07-28  8:00       ` Paul Jackson
2004-08-04 20:03       ` Robert White
2004-08-04 20:42         ` Roger Luethi
2004-07-28  8:05 ` Paul Jackson
2004-07-28 11:54   ` Marc Ballarin
2004-07-28 16:46     ` Rob Landley
2004-07-28 16:42   ` Rob Landley
2004-07-28 17:08     ` Tristan Wibberley
2004-07-29 23:56 ` Roger Luethi
2004-07-30  0:18   ` Jesper Juhl
2004-07-30  0:22     ` Jesper Juhl
2004-07-30  8:27   ` Marc Ballarin
2004-07-30  8:38     ` Roger Luethi
2004-08-20 10:15   ` Lee Revell
2004-08-20 12:51     ` Marc Ballarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ce6e3r$i4n$1@gatekeeper.tmr.com' \
    --to=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.