bug-bash
[Top][All Lists]
Advanced

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

Fwd: Re: 5.2.37: bg(1)ed job then only runs partially


From: Steffen Nurpmeso
Subject: Fwd: Re: 5.2.37: bg(1)ed job then only runs partially
Date: Wed, 23 Oct 2024 00:40:11 +0200
User-agent: s-nail v14.9.25-623-g395f648fc2

..sorry..

--- Forwarded from Steffen Nurpmeso <steffen@sdaoden.eu> ---
Date: Wed, 23 Oct 2024 00:39:14 +0200
Author: Steffen Nurpmeso <steffen@sdaoden.eu>
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: chet.ramey@case.edu
Subject: Re: 5.2.37: bg(1)ed job then only runs partially
Message-ID: <20241022223914.Qg9LVo-4@steffen%sdaoden.eu>

Chet Ramey wrote in
 <d027b81a-767c-4690-8c31-c5c2b54cba07@case.edu>:
 |On 10/21/24 6:29 PM, Steffen Nurpmeso wrote:
 |> So first: this thread must not even start if the answer is "bash
 |> justs sends a signal to the job's entire process group, if the
 |> programs do not properly deal with that it cannot help that".
 |> (ogg123 in particular is known to have signal issues.)
 |> This just in case possible changes brought in possible bugs.
 |
 |Yes, that's what bash does.

Thank you very much.

 |Bash-5.2 checks whether it thinks the job is running first, and only sends
 |the SIGCONT if it's not. Since you got the "Stopped" message, bash thinks
 |the job is stopped. The current devel version sends SIGCONT without
 |checking. That shouldn't make a difference here.
 |
 |bash-5.2:
 |
 |   /* If the job is already running, then don't bother jump-starting it. */
 |   if (already_running == 0)
 |     {
 |       jobs[job]->flags |= J_NOTIFIED;
 |       killpg (jobs[job]->pgrp, SIGCONT);
 |}
 |
 |bash devel:
 |
 |   /* Change job state to running only if the kill SIGCONT succeeds \
 |   or if kill
 |      says the process has terminated so we clean it up later. */
 |   if (killpg (jobs[job]->pgrp, SIGCONT) >= 0 || errno == ESRCH)
 |     set_job_running (job);

Oh.  Well ... software *should* be able to deal with successive
CONTs, and it will be interesting to see if that is right :)

Thanks again,
  ...
 -- End forward <20241022223914.Qg9LVo-4@steffen%sdaoden.eu>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

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