Il giorno lun 14 feb 2022 alle ore 17:21 סאן עמר <[email protected]> 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 minutes before > it exits and meanwhile the pid’s are continuing and wrap around to the point > that at the moment it release is the exact same moment when the next_pid is > the same one as the process that just exits.
While the timeout is sleeping for 1 second, the supervised PID process dies and another one process starts with the same PID, then the timeout wakes-up and checks for the PID then the race condition happens if the PID process will last longer than the expiring timeout. How much is probable the PID race condition? It related to these factors: - long timeout is used - a lot of processes is created - a lot of processes is running - small maximum PID is used It could happen despite any oddity, by design. That's true. However, it is not avoidable unless timeout does not establish a child-parent relationship with the surveilled process as shown by Rob. Best regards, -- Roberto A. Foglietta +39.349.33.30.697 _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
