aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2023-06-15 00:13:50 -0700
committerGitHub <noreply@github.com>2023-06-15 09:13:50 +0200
commitee64538c9ffd9061beed35146e37813a1e26a152 (patch)
tree63b00ea1316201e0d68f07c2ab3999544ce6729d /executor/common.h
parent76decb8275c764d309b8daf5ab9dc573b2411ddf (diff)
executor: use exitf instead of fail outside of setup sequence (#3959)
We have a long history of executor managing to corrupt itself in various interesting ways (e.g. using read with a pointer pointing to some global/stack variable and then kernel overwrites it). Or rt_sigreturn can corrupt other registers which won't cause immediate SIGSEGV, but rather some random behavior later. This is the race we can't win. We can't rely on memory consistency when the test already started, so we should use exitf instead of fail outside of setup sequence (and relying more on unit testing to ensure that executor works as expected for sane programs). Suggested-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Andrei Vagin <avagin@google.com>
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common.h b/executor/common.h
index efdb4496f..32df69001 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -408,7 +408,7 @@ static void event_set(event_t* ev)
{
pthread_mutex_lock(&ev->mu);
if (ev->state)
- fail("event already set");
+ exitf("event already set");
ev->state = 1;
pthread_mutex_unlock(&ev->mu);
pthread_cond_broadcast(&ev->cv);