From nobody Thu Jan 23 03:31:55 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=ispras.ru ARC-Seal: i=1; a=rsa-sha256; t=1737554409; cv=none; d=zohomail.com; s=zohoarc; b=SWTJy0r5HvYF/5xtFkduMVmUdxgfi6DYNgbkWFz+DKHVVki7ceYI6XommlAYfas3IPZXBa2fsSp/8eRxTOSTzgnuwlmmZp7hqTQ1qFMwrY1OTWu2ER8dU7QWWoG0E98A7MywluqbHQSO/d/xN0JyY1wQREFfUyAG+dDfaqiPf7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737554409; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9anfFtl2ioc0X2PL6BB832cZTQjaWaaUD1brShBffTY=; b=M3p4EzdBBCI3csaeRlZBI0PRjH+RrkSbi8seNBjMcwOoHF169H5npi55NWz3a6APsHHgkP9KWN7NDTm6XxjhfenBqLXhzMC+sazRbV+1HQLP04wHKiCm73UK77MASsKHBYPWf+qm9FBmeg9ZID39PC+x5vXcxMGGL2O8Z1u8Kdg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173755440947567.67286476078266; Wed, 22 Jan 2025 06:00:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tabGF-0003U4-77; Wed, 22 Jan 2025 08:59:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tabGD-0003Tq-IF for qemu-devel@nongnu.org; Wed, 22 Jan 2025 08:59:13 -0500 Received: from mail.ispras.ru ([83.149.199.84]) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tabG8-0004PF-OE for qemu-devel@nongnu.org; Wed, 22 Jan 2025 08:59:13 -0500 Received: from Neilbrown.intra.ispras.ru (unknown [10.10.2.179]) by mail.ispras.ru (Postfix) with ESMTPSA id 9AD7640B2261; Wed, 22 Jan 2025 13:59:02 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 9AD7640B2261 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1737554342; bh=9anfFtl2ioc0X2PL6BB832cZTQjaWaaUD1brShBffTY=; h=From:To:Cc:Subject:Date:From; b=JiufbIRsAMDtHWkTuPIzzW/GAQK5o8a3QmSu0QS9C+e8u261Nq3ygAtCpkS5lZ+8w jjJlLKdCSw8AdB433qiD7EdTY/LvvLUKwiZZ3kX9Qm/B0NqxlTX+9jGjwDqE0jeZv4 wIqcQnLCUUFcvIeVOcQHYr3wVn993SoR9BPZLlw8= From: Vitalii Mordan To: Thomas Huth Cc: Vitalii Mordan , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , qemu-devel@nongnu.org, sdl.qemu@linuxtesting.org, Vadim Mutilin , Alexey Khoroshilov Subject: [PATCH] Fix a data race with goflag in rcutorture test Date: Wed, 22 Jan 2025 16:58:43 +0300 Message-Id: <20250122135843.543387-1-mordan@ispras.ru> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=83.149.199.84; envelope-from=mordan@ispras.ru; helo=mail.ispras.ru X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ispras.ru) X-ZM-MESSAGEID: 1737554412094019000 Content-Type: text/plain; charset="utf-8" This patch addresses a potential data race involving the global variable goflag in the rcutorture test. The issue is resolved by adding the atomic qualifier to ensure proper synchronization. Fixes: 8fda74a52b ("rcu: add rcutorture") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2750 Signed-off-by: Vitalii Mordan --- tests/unit/rcutorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/rcutorture.c b/tests/unit/rcutorture.c index 7662081683..c4971632f8 100644 --- a/tests/unit/rcutorture.c +++ b/tests/unit/rcutorture.c @@ -70,7 +70,7 @@ int nthreadsrunning; #define GOFLAG_RUN 1 #define GOFLAG_STOP 2 =20 -static volatile int goflag =3D GOFLAG_INIT; +static _Atomic int goflag =3D GOFLAG_INIT; =20 #define RCU_READ_RUN 1000 =20 --=20 2.34.1