From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] igt_core: Avoid exit_subtest in subthread
Date: Mon, 12 Jun 2023 19:19:08 +0200 [thread overview]
Message-ID: <20230612171908.29906-1-kamil.konieczny@linux.intel.com> (raw)
From: Petri Latvala <petri.latvala@intel.com>
If a thread crashes, the signal handler for SIGSEGV and pals try to
make the subtest fail and eventually longjmps out of the
subtest. Naturally this can cause multiple threads to yield subtest
results and other weirdness.
We already check for non-main-thread in igt_fail_assert() but the path
from a signal handler to subtest exit doesn't have such protection.
Cc: Petri Latvala <adrinael@adrinael.net>
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/igt_core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index cd9c2002d..1d8e3a6ee 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1585,6 +1585,11 @@ __noreturn static void exit_subtest(const char *result)
struct timespec *thentime = in_dynamic_subtest ? &dynamic_subtest_time : &subtest_time;
jmp_buf *jmptarget = in_dynamic_subtest ? &igt_dynamic_jmpbuf : &igt_subtest_jmpbuf;
+ if (!igt_thread_is_main()) {
+ igt_thread_fail();
+ pthread_exit(NULL);
+ }
+
igt_gettime(&now);
if (test_multi_fork_child)
--
2.39.2
next reply other threads:[~2023-06-12 17:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 17:19 Kamil Konieczny [this message]
2023-06-12 18:35 ` [igt-dev] ✓ Fi.CI.BAT: success for igt_core: Avoid exit_subtest in subthread Patchwork
2023-06-13 3:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-06-13 16:38 ` Kamil Konieczny
2023-06-15 12:58 ` Yedireswarapu, SaiX Nandan
2023-06-15 12:54 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2023-06-16 9:53 ` [igt-dev] [PATCH i-g-t] " Zbigniew Kempczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230612171908.29906-1-kamil.konieczny@linux.intel.com \
--to=kamil.konieczny@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox