[PATCH 16/18] tests/tcg: Use SIGKILL for timeout

Alex Bennée posted 18 patches 3 years ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>
[PATCH 16/18] tests/tcg: Use SIGKILL for timeout
Posted by Alex Bennée 3 years ago
From: Richard Henderson <richard.henderson@linaro.org>

linux-user blocks all signals while attempting to handle guest
signals (e.g. ABRT), which means that the default TERM sent by timeout
has no effect -- KILL instead.

When a guest aborts (possible nios2 guest bug), sending SIGABRT to
itself, I have caught one thread waiting in start_exclusive, and all
of the others blocked in exclusive_idle. I look at that and think
there's a bug in our start_exclusive locking, but I can't prove it.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230117035701.168514-2-richard.henderson@linaro.org>
[AJB: expanded commit message from cover letter]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/Makefile.target | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index 14bc013181..a3b0aaf8af 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -54,10 +54,10 @@ cc-option = if $(call cc-test, $1); then \
 
 # $1 = test name, $2 = cmd, $3 = desc
 ifeq ($(filter %-softmmu, $(TARGET)),)
-run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out, \
+run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2 > $1.out, \
 	TEST,$(or $3, $*, $<) on $(TARGET_NAME))
 else
-run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2, \
+run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2, \
         TEST,$(or $3, $*, $<) on $(TARGET_NAME))
 endif
 
-- 
2.34.1


Re: [PATCH 16/18] tests/tcg: Use SIGKILL for timeout
Posted by Richard Henderson 3 years ago
On 1/19/23 08:04, Alex Bennée wrote:
> From: Richard Henderson <richard.henderson@linaro.org>
> 
> linux-user blocks all signals while attempting to handle guest
> signals (e.g. ABRT), which means that the default TERM sent by timeout
> has no effect -- KILL instead.
> 
> When a guest aborts (possible nios2 guest bug), sending SIGABRT to
> itself, I have caught one thread waiting in start_exclusive, and all
> of the others blocked in exclusive_idle. I look at that and think
> there's a bug in our start_exclusive locking, but I can't prove it.

I don't think this bit of the cover letter is helpful here.
It was just the sigprocmask in process_pending_signals that
was relevant.

Anyway...


> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> Message-Id: <20230117035701.168514-2-richard.henderson@linaro.org>
> [AJB: expanded commit message from cover letter]
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>