bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: job-control warning message that maybe shouldn't be printed


From: Peter Cordes
Subject: Re: job-control warning message that maybe shouldn't be printed
Date: Fri, 29 Nov 2013 00:39:07 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, Nov 28, 2013 at 12:40:34PM -0500, Chet Ramey wrote:
> On 11/28/13, 7:23 AM, Peter Cordes wrote:
> >  I submitted this on savannah a couple days ago:
> > https://savannah.gnu.org/support/?108450
> > 
> >  As I said there, the warning message for bash re-using a PID that
> > it's tracking for exitted processes in suspended pipelines or w/e has
> > an off-by-one error (jobs.c:892).
> 
> Thanks for the report.  The message is just informational and designed
> to reveal the cases in which this happens.  I have to say that I didn't
> expect anyone to leave a multi-process pipeline suspended for a week
> and trigger it.

 Yeah, I was surprised how many old glimpse | egrep | egrep | less
searches on his genealogy files my dad has suspended, too.  And he
thinks my mom is weird for leaving a ton of firefox tabs open. :P

 Part of what I was trying to say is that it wasn't clear from the
message itself that it was just informational, and not a sign of some
kind of error.  (like the machine developing bad RAM, leading to
failed sanity checks in processes, who knows?)  So maybe a wording
change would be in order.  Maybe using terms that make sense to people
that aren't thinking about bash internals.  e.g.

"note: PID %d of exitted process in job %d was reused\n"

Debating between "note", and "debug", and IDK what else would be good.

 The big confusion for my dad was that none of the suspended jobs were
"running", they were all suspended.  (as opposed to bg'ed.) He's been
using Unix and Linux for something like 20 years now, a few more than
me, a but mostly just as a user, not so much sysadmin or systems
programming.  So I think we can take his reaction as that of an
experienced but non-hacker user, if that helps.

 Probably very few people ever see this message, so I'm probably
overthinking this.  Still, while you're fixing the off-by-one, might
want to update the wording if you like my suggestion.


>  The original motivation for the message was to figure out
> how big the pid-reuse problem was after a discussion started by
> 
> http://lists.gnu.org/archive/html/bug-bash/2012-07/msg00054.html
>
> That's where you see the Posix requirement that shells save the exit
> status of the last CHILD_MAX processes.

 Ah.  Thanks for the background on why this message was there in the
first place.  I guessed there must have been something that someone was
worried about or was trying to debug, in a very different use-case
from mine.


> Bash does the right thing; it zeroes out the saved pid information.

 Indeed, I noticed the code to do that had worked correctly, looking
at jobs -l.  (That's also how I was sure there was an off-by-one,
since the zeroed PID was in job 23, not 22.)

 If saving PIDs of exitted processes in suspended pipelines is
required, then the only decision left is what the warning message
should be when it has to zero out one of them, if any.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter@cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]