delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/12/04:54:39

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4AC9scDU4104260
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4AC9scDU4104260
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=XYEf7yDb
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 255693858C31
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1731405277;
bh=DgTB4KLXDe3HRqrP7ObbI0Luw/CUUg6fmW7bnaX4EdE=;
h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:Cc:From;
b=XYEf7yDbCxP024HpvEb6/ScRVep733tBL0xXt0m2ECvUKeqotN8MLVrEO+Aqkwb1L
odqbGt2JZKvaOVL9a10y8Yw9ZiqK8qZdBKum7vgiPEr4oMQOIXjF0+idL0LC1pfceg
FqnFN2O9hPMiDBp2lcRO4KvuAgT+WQaVmUucaMpk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29C063858D39
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 29C063858D39
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731405256; cv=none;
b=Q/E+hKSU7C/7uJdpGrk1/pzaLXa3wwI7NHMCbIqlCq0zINiIrHL2M/v1ShBXEi8x5RkoRjsZrbM8bglrZ2z5miqQvoOvygOfRDx02hMiZk6sslmvhx+5PfcOLbs8Hq/QCm48E6ZEyJu2Ajjha5Ozzng/D+st+tFvaeXONc+jrVI=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1731405256; c=relaxed/simple;
bh=8D2LrFPoZiYY7RPA7f5AuzJ2AjXkGaFv9f4JoKVM6xE=;
h=From:Subject:To:Message-ID:Date:MIME-Version;
b=U6KLERnEin0jPZNz5bt7zA+3ed43jneyhaq/pETLd0mZ9xeq+Y9YGoNmN6yYt0vQzSKxYiy7z1eY7w3qJiLWs9dpaLWmk9GAXuG8G5puWvgjEl0UdHdX7wEFrDzG2u3YjOmLGKwrLJTynWvJ8QuDBPK2bpxvTIkc+CQklxxBJE4=
ARC-Authentication-Results: i=1; server2.sourceware.org
Subject: SIGKILL may no longer work after many SIGCONT/SIGSTOP signals
To: cygwin AT cygwin DOT com
Message-ID: <adc78776-84f6-82bc-13b4-3a51b11027fa@t-online.de>
Date: Tue, 12 Nov 2024 10:53:58 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
SeaMonkey/2.53.18.2
MIME-Version: 1.0
X-TOI-EXPURGATEID: 150726::1731405240-A17F0C42-CB6EC85D/0/0 CLEAN NORMAL
X-TOI-MSGID: 08860342-3afa-4716-9fdd-bf1801eae8d7
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Christian Franke via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Christian Franke <Christian DOT Franke AT t-online DOT de>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

This is a multi-part message in MIME format.
--------------7E90F3CBC07190F14D627145
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Found with 'stress-ng --cpu-sched' from current stress-ng upstream HEAD:

Testcase (attached):

$ gcc -O2 -o manysignals manysignals.c

$ ./manysignals
fork() = 1833
...
fork() = 1848
...
kill(1833, 17)
...
kill(1848, 17)
kill(1833, 9)
...
kill(1848, 9)
waitpid(1833, ., 0)


Run this in second terminal:

$ watch "ps | sed -n '1p;/manysignals/{/sed/d;p}'"

If 'S' appear in the first column, the child processes likely reached 
the final SIGSTOP state. This takes some time. The parent process may 
still hang in first waitpid() but should not.

If the parent process is aborted with ^C, child processes may be stopped 
or left behind. Occasionally a child process that can not be stopped by 
Cygwin (kill -9) is left behind.

Tested with ancient (i7-2600K) and more recent (i7-14700K) CPU :-)


Unrelated to the above, but related to 'stress-ng --cpu-sched' which 
uses sched_get/setscheduler():

- sched_getscheduler() always returns SCHED_FIFO. As far as I understand 
Linux sched(7), this is a non-preemptive real-time policy. The 
preemptive SCHED_RR would possibly a more reasonable value. 
Unfortunately SCHED_OTHER cannot be used because it would require to 
ignore the priority.

- sched_setscheduler() always fails with ENOSYS. It IMO should allow to 
set 'param->sched_priority' if 'policy' is equal to the value returned 
by sched_getscheduler().

-- 
Regards,
Christian


--------------7E90F3CBC07190F14D627145
Content-Type: text/plain; charset=UTF-8;
 name="manysignals.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="manysignals.c"

I2RlZmluZSBfR05VX1NPVVJDRQ0KI2luY2x1ZGUgPHNjaGVkLmg+DQojaW5jbHVkZSA8c2ln
bmFsLmg+DQojaW5jbHVkZSA8c3RkaW8uaD4NCiNpbmNsdWRlIDx1bmlzdGQuaD4NCiNpbmNs
dWRlIDx3YWl0Lmg+DQoNCnN0YXRpYyB2b2lkIHhraWxsKHBpZF90IHBpZCwgaW50IHNpZykN
CnsNCiAgcHJpbnRmKCJraWxsKCVkLCAlZClcbiIsIChpbnQpcGlkLCBzaWcpOw0KICBpbnQg
cmV0ID0ga2lsbCh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oaW50IHAgPSAwOyBwIDwgbnByb2NzOyBw
KyspDQogICAgICB4a2lsbChwaWRzW3BdLCBTSUdDT05UKTsNCiAgfQ0KDQogIGZvciAoaW50
IHAgPSAwOyBwIDwgbnByb2NzOyBwKyspDQogICAgeGtpbGwocGlkc1twXSwgU0lHS0lMTCk7
DQoNCiAgZm9yIChpbnQgcCA9IDA7IHAgPCBucHJvY3M7IHArKykgew0KICAgIHBpZF90IHBp
ZCA9IHBpZHNbcF07DQogICAgcHJpbnRmKCJ3YWl0cGlkKCVkLCAuLCAwKVxuIiwgKGludClw
aWQpOyBmZmx1c2goc3Rkb3V0KTsNCiAgICBpbnQgc3RhdHVzOw0KICAgIHBpZF90IHJldCA9
IHdhaXRwaWQocGlkLCAmc3RhdHVzLCAwKTsNCiAgICBpZiAocmV0ID09IChwaWRfdCktMSkN
CiAgICAgIHBlcnJvcigid2FpdHBpZCIpOw0KICB9DQogIHJldHVybiAwOw0KfQ0K
--------------7E90F3CBC07190F14D627145
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--------------7E90F3CBC07190F14D627145--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019