Hi Craig,

thank you for your efforts!

I added some debug code to killall.c and found out, that process_age_sec is either 0.000000 or 0.010000. If process_age_sec happens to be 0.000000, the process gets killed although it is younger than 1h. The locale and architecture seem to affect the timing, but do not cause the problem itself.

The following patch fixes the problem:

--- killall.c.orig      2017-03-29 19:21:01.693936749 +0200
+++ killall.c   2017-03-29 19:29:14.185785335 +0200
@@ -464,7 +464,7 @@

if ( younger_than && process_age_sec && (process_age_sec > younger_than ) )
                 continue;
- if ( older_than && process_age_sec && (process_age_sec < older_than ) )
+             if ( older_than   && (process_age_sec < older_than ) )
                 continue;
        
              if (!sts[j].st_dev)

I think the check of process_age_sec should be removed in both cases, as killall skips the current pid, if it fails to read the progress age anyway.

--
Mit freundlichen Grüßen,

Jörg Ludwig

IServ GmbH
Bültenweg 73
38106 Braunschweig

Telefon:     0531-2243666-0
Fax:         0531-2243666-9
Mobil:       0179-9101055
E-Mail:      joerg.lud...@iserv.eu
Internet:    www.iserv.eu
USt.-IdNr.:  DE265149425

Am 25.03.2017 um 08:38 schrieb Craig Small:
tags 822861 unreproducible
thankyou

Hi Jörg,
  I am unable to make this problem occur. To me I'm not even sure how
the locale could cause this problem.

I tried on a debian i386 chroot and it worked fine, see below.
No Processes found, I believe its telling me.

(sid_i386-dchroot)csmall@barriere:~$ sleep 5 & LC_ALL=de_DE.UTF-8
killall --older-than 1h sleep
[1] 11121
sleep: Kein Prozess gefunden
(sid_i386-dchroot)csmall@barriere:~$ dpkg -l psmisc
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  psmisc         22.21-2.1+b2 i386         utilities that use the proc
file


Reply via email to