Re: suspected bug in timeout command

2022-03-02 Thread Steffen Nurpmeso
Raffaello D. Di Napoli wrote in <3b0697d2-01b6-d36b-10da-32d8cf917...@dinapo.li>: |On 3/2/22 03:50, Michael Conrad wrote: |> On 3/2/22 02:45, Raffaello D. Di Napoli wrote: |>> On 3/1/22 16:57, Denys Vlasenko wrote: |>>> On Tue, Mar 1, 2022 at 5:39 PM Denys Vlasenko |>>> wrote: ... |

Re: suspected bug in timeout command

2022-03-02 Thread Michael Conrad
On 3/2/22 02:45, Raffaello D. Di Napoli wrote: On 3/1/22 16:57, Denys Vlasenko wrote: On Tue, Mar 1, 2022 at 5:39 PM Denys Vlasenko wrote: Meanwhile: what "timeout" is doing is it tries to get out of the way of the PROG to be launched so that timeout's parent sees PROG (not timeout) as a

Re: suspected bug in timeout command

2022-03-01 Thread Rob Landley
On 3/1/22 4:15 PM, David Laight wrote: > From: Denys Vlasenko >> Sent: 01 March 2022 21:57 >> >> On Tue, Mar 1, 2022 at 5:39 PM Denys Vlasenko >> wrote: >> > Meanwhile: what "timeout" is doing is it tries to get out >> > of the way of the PROG to be launched so that timeout's parent >> >

Re: suspected bug in timeout command

2022-03-01 Thread Rob Landley
On 3/1/22 1:45 PM, Denys Vlasenko wrote: > On Tue, Mar 1, 2022 at 6:52 PM Steffen Nurpmeso wrote: >> David Laight wrote in >> : >> |From: Denys Vlasenko >> |> Sent: 01 March 2022 16:40 >> |> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: >> |>> On 2/14/22 10:09 AM, Roberto A.

Re: suspected bug in timeout command

2022-03-01 Thread Steffen Nurpmeso
David Laight wrote in <3c1a02d162c34e908af85ac008a87...@acums.aculab.com>: |From: Steffen Nurpmeso |> Sent: 01 March 2022 17:49 |> David Laight wrote in |> : |>|From: Denys Vlasenko |>|> Sent: 01 March 2022 16:40 |>|> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: |>|>> On 2/14/22

Re: suspected bug in timeout command

2022-03-01 Thread Steffen Nurpmeso
Denys Vlasenko wrote in : |On Tue, Mar 1, 2022 at 6:52 PM Steffen Nurpmeso wrote: |> David Laight wrote in |> : |>|From: Denys Vlasenko |>|> Sent: 01 March 2022 16:40 |>|> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: |>|>> On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: |> ...

RE: suspected bug in timeout command

2022-03-01 Thread David Laight
From: Denys Vlasenko > Sent: 01 March 2022 22:40 > > On Tue, Mar 1, 2022 at 11:15 PM David Laight wrote: > > From: Denys Vlasenko > > > and a separate "spawn 40k 'sleep 0.03'" loop > > > seems to indicate that openat(fd, ".") on the exited > > > /proc/PID fails, and continues to fail > > > even

Re: suspected bug in timeout command

2022-03-01 Thread Denys Vlasenko
On Tue, Mar 1, 2022 at 11:15 PM David Laight wrote: > From: Denys Vlasenko > > and a separate "spawn 40k 'sleep 0.03'" loop > > seems to indicate that openat(fd, ".") on the exited > > /proc/PID fails, and continues to fail > > even if another process with this PID exists > > again (pid was

RE: suspected bug in timeout command

2022-03-01 Thread David Laight
From: Steffen Nurpmeso > Sent: 01 March 2022 17:49 ... > > David Laight wrote in > : > |From: Denys Vlasenko > |> Sent: 01 March 2022 16:40 > |> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: > |>> On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: > ... > |> My memory is hazy on this,

RE: suspected bug in timeout command

2022-03-01 Thread David Laight
From: Denys Vlasenko > Sent: 01 March 2022 21:57 > > On Tue, Mar 1, 2022 at 5:39 PM Denys Vlasenko > wrote: > > Meanwhile: what "timeout" is doing is it tries to get out > > of the way of the PROG to be launched so that timeout's parent > > sees PROG (not timeout) as a child. E.g. it can send

Re: suspected bug in timeout command

2022-03-01 Thread Denys Vlasenko
On Tue, Mar 1, 2022 at 5:39 PM Denys Vlasenko wrote: > Meanwhile: what "timeout" is doing is it tries to get out > of the way of the PROG to be launched so that timeout's parent > sees PROG (not timeout) as a child. E.g. it can send signals > to it, get waitpid notifications if PROG has been

Re: suspected bug in timeout command

2022-03-01 Thread Denys Vlasenko
On Tue, Mar 1, 2022 at 6:52 PM Steffen Nurpmeso wrote: > David Laight wrote in > : > |From: Denys Vlasenko > |> Sent: 01 March 2022 16:40 > |> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: > |>> On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: > ... > |> My memory is hazy on this,

Re: suspected bug in timeout command

2022-03-01 Thread Rob Landley
On 3/1/22 10:39 AM, Denys Vlasenko wrote: > On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: >> On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: >> > However, if this bug shows-up, probably it means that the system has >> > a lot of processes running and a lot of processes created and >> >

Re: suspected bug in timeout command

2022-03-01 Thread Steffen Nurpmeso
Hello. ..despite that particular timeout(1), i have not looked.. David Laight wrote in : |From: Denys Vlasenko |> Sent: 01 March 2022 16:40 |> On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: |>> On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: ... |> My memory is hazy on this, but

RE: suspected bug in timeout command

2022-03-01 Thread David Laight
From: Denys Vlasenko > Sent: 01 March 2022 16:40 > > On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: > > On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: > > > However, if this bug shows-up, probably it means that the system has > > > a lot of processes running and a lot of processes

Re: suspected bug in timeout command

2022-03-01 Thread Denys Vlasenko
On Tue, Feb 15, 2022 at 12:31 PM Rob Landley wrote: > On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: > > However, if this bug shows-up, probably it means that the system has > > a lot of processes running and a lot of processes created and > > destroyed compared to the max PID available. Thus,

Re: suspected bug in timeout command

2022-02-15 Thread Rob Landley
On 2/14/22 10:09 AM, Roberto A. Foglietta wrote: > However, if this bug shows-up, probably it means that the system has > a lot of processes running and a lot of processes created and > destroyed compared to the max PID available. Thus, the system might be > incorrectly configured compared with

Re: suspected bug in timeout command

2022-02-14 Thread Roberto A. Foglietta
Il Sab 12 Feb 2022, 14:13 David Laight ha scritto: > From: Michael Conrad > > Sent: 12 February 2022 12:59 > > > > On 2/12/22 07:38, Michael Conrad wrote: > > > Correctly using pidfd *still* requires that you be the parent process, > > > else the child could get reaped and replaced before the

RE: suspected bug in timeout command

2022-02-14 Thread David Laight
Yes it does. But it is unlikely to happen in the short time between some kind of test that the process is the right one, and sending the signal. But hoping to see the process ‘gone’ on a 1 second poll is pretty useless. So if the process’s ‘start time’ is found (before any of the forks) that can

Re: suspected bug in timeout command

2022-02-14 Thread Roberto A. Foglietta
‪Il giorno lun 14 feb 2022 alle ore 17:21 ‫סאן עמר‬‎ ha scritto:‬ > > Im in not wrong linux use a simple allocation method for pid’d were it just > set the next pid to last pid allocated + 1. Then check if its free and if not > keep adding until found free one. A process can be created few

Re: suspected bug in timeout command

2022-02-14 Thread סאן עמר
Im in not wrong linux use a simple allocation method for pid’d were it just set the next pid to last pid allocated + 1. Then check if its free and if not keep adding until found free one. A process can be created few minutes before it exits and meanwhile the pid’s are continuing and wrap around to

Re: suspected bug in timeout command

2022-02-14 Thread Roberto A. Foglietta
Il giorno lun 14 feb 2022 alle ore 17:00 Roberto A. Foglietta ha scritto: > > Il giorno sab 12 feb 2022 alle ore 02:41 Raffaello D. Di Napoli > ha scritto: > > > > > > On 2/11/22 16:22, Rob Landley wrote: > > > On 2/9/22 11:12 AM, Baruch Siach wrote: > > >> Hi Sun, > > >> > > >> On Wed, Feb 09

Re: suspected bug in timeout command

2022-02-14 Thread Roberto A. Foglietta
Il giorno sab 12 feb 2022 alle ore 02:41 Raffaello D. Di Napoli ha scritto: > > > On 2/11/22 16:22, Rob Landley wrote: > > On 2/9/22 11:12 AM, Baruch Siach wrote: > >> Hi Sun, > >> > >> On Wed, Feb 09 2022, סאן עמר wrote: > >>> Hi, I'm using busybox for a while now (v1.29.2). and I had an issue

Re: suspected bug in timeout command

2022-02-14 Thread Laurent Bercot
/* We want to create a grandchild which will watch * and kill the grandparent. Other methods: * making parent watch child disrupts parent<->child link * (example: "tcpsvd 0.0.0.0 1234 timeout service_prog" - * it's better if service_prog is a child of tcpsvd!), * making child watch parent

Re: suspected bug in timeout command

2022-02-13 Thread Rob Landley
On 2/13/22 1:31 AM, סאן עמר wrote: > Hey, first of all thanks for your answers and sorry for how I phrase my > question. Sorry, looks like I may be the one who needs to apologize. (See below.) > Rob, I still need a clarification if you don't mind. anything that you mention > is making sense to

Re: suspected bug in timeout command

2022-02-12 Thread סאן עמר
Hey, first of all thanks for your answers and sorry for how I phrase my question. Rob, I still need a clarification if you don't mind. anything that you mention is making sense to me if the timeout implementation here was that the actual command is a child process of a process that doing the

RE: suspected bug in timeout command

2022-02-12 Thread David Laight
From: Michael Conrad > Sent: 12 February 2022 12:59 > > On 2/12/22 07:38, Michael Conrad wrote: > > Correctly using pidfd *still* requires that you be the parent process, > > else the child could get reaped and replaced before the pidfd is > > created.  As far as I can tell, the only purpose of

Re: suspected bug in timeout command

2022-02-12 Thread Michael Conrad
On 2/12/22 07:38, Michael Conrad wrote: Correctly using pidfd *still* requires that you be the parent process, else the child could get reaped and replaced before the pidfd is created.  As far as I can tell, the only purpose of pidfd is for waking on poll() instead of using signals, which is

Re: suspected bug in timeout command

2022-02-12 Thread Michael Conrad
On 2/12/22 06:08, David Laight wrote: From: Raffaello D. Di Napoli Sent: 12 February 2022 01:33 On 2/11/22 16:22, Rob Landley wrote: On 2/9/22 11:12 AM, Baruch Siach wrote: Hi Sun, On Wed, Feb 09 2022, סאן עמר wrote: Hi, I'm using busybox for a while now (v1.29.2). and I had an issue with

RE: suspected bug in timeout command

2022-02-12 Thread David Laight
From: Raffaello D. Di Napoli > Sent: 12 February 2022 01:33 > > > On 2/11/22 16:22, Rob Landley wrote: > > On 2/9/22 11:12 AM, Baruch Siach wrote: > >> Hi Sun, > >> > >> On Wed, Feb 09 2022, סאן עמר wrote: > >>> Hi, I'm using busybox for a while now (v1.29.2). and I had an issue with > >>> a

Re: suspected bug in timeout command

2022-02-11 Thread Rob Landley
On 2/9/22 11:12 AM, Baruch Siach wrote: > Hi Sun, > > On Wed, Feb 09 2022, סאן עמר wrote: >> Hi, I'm using busybox for a while now (v1.29.2). and I had an issue with a >> sigterm send randomly to a process of mine. I debugged it until I found >> it from the timeout process which was assigned

Re: suspected bug in timeout command

2022-02-09 Thread Michael Conrad
On 2/9/22 12:12, Baruch Siach wrote: Hi Sun, On Wed, Feb 09 2022, סאן עמר wrote: Hi, I'm using busybox for a while now (v1.29.2). and I had an issue with a sigterm send randomly to a process of mine. I debugged it until I found it from the timeout process which was assigned before to another

suspected bug in timeout command

2022-02-09 Thread סאן עמר
Hi, I'm using busybox for a while now (v1.29.2). and I had an issue with a sigterm send randomly to a process of mine. I debugged it until I found it from the timeout process which was assigned before to another process with the same pid. (i'm using a lot of timeouts for a lot of jobs) so i looked