Signals may be lost during setjmp or longjmp

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Fri Nov 22 21:10:55 GMT 2024


On 2024-11-22 07:22, Christian Franke via Cygwin wrote:
> The command 'stress-ng --longjmp ... -t 1' occasionally fails to terminate 
> because some child process does not receive the SIGALRM indicating timeout.
> 
> Testcase (attached):
> 
> $ g++ -O2 -o longjmpsigs longjmpsigs.cc
> 
> $ ./longjmpsigs
> [^C]
> INT   1
> [^C]
> INT   2
> ...
> [^C]
> INT   21
> [^C]
> [^C]
> INT   22
> ...
> 
> The following run in a second window may not stop the process due to few lost 
> signals:
> 
> for i in {1..100}; do
>    echo $i; killall -INT longjmpsigs || break; sleep 1
> done
> 
> The problem does not occur if a regular loop is used instead of setjmp/longjmp.
> 
> Reproducible also with current cygwin1.dll 26144e40.

I have some cygport package build tests which hang and need killed despite them 
using usual test harnesses setting timeouts, typically running ~100% all CPUs!

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list