Message ID | orfs1fhf0k.fsf@lxoliva.fsfla.org |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp162954vqs; Wed, 8 Nov 2023 17:50:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3+Fbgx9nwlysymus/5gGMA1amHpuKfsCx7VAzaoTsTHrJmKhGzlvrNyrX40R3epdBZAM4 X-Received: by 2002:ac8:7d50:0:b0:41c:c205:f718 with SMTP id h16-20020ac87d50000000b0041cc205f718mr4160797qtb.45.1699494632123; Wed, 08 Nov 2023 17:50:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699494632; cv=pass; d=google.com; s=arc-20160816; b=h0k85ZdqxaSBIgVDJUSuQIEMWJYAHPtHrQCy9lHPty8kwLkddZIsaXFViGW8vRZ2td AWOefoqRiPWjgBtx2NQSlAINQjkY4xqbFF8Xua2Sp3/u8Xvc3sj3l3uPJzmIirsexzDA Yz7z74Z9YlC5tcfg7eazQShe1eJRM+P/Paa2hfi/8SFhUGzH1dGuc3yX5l19B0WRnN5b XMrdUWLhgn5vQ/7R9G2uYb6NopnurbL36Ugw+3/JZVVRgTNCX+HgRPjU2WpB9jn7HbPG T95QoFE4R8sYkYs1IRlTkT4vxTVazztIWbQyDyYAVabY2C9C7SaXroxLF81NGQ5VCpzw QXAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:organization:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZtsKMiNZU4J7m+wuQb5gRIqsnM6kcDmK7MdNye/ZFNw=; fh=oexAcL1GQ/7KI5o7JIA5z5L7G+umyjSpuUDYjScX5yc=; b=ZbZ7VeI/hDeB4FPjZ8fBuZ9IXV5pgQ1UymeXCcvGdcP+AlzsDmXXyxdDfry87f0ag8 V1Amo/vV9mGVJdoxian9EfRVRp4hH1EfDSETGZ44/S7kCvpqPAS/ZqYOFz0//JXI6bcp p/qleX7F5ycBxoqzigAFNjGCF9/VvvLxYNkdas0OfXil3yNAVOnKiFTKVx9FszZWGVdF p130fdEkAGvOn8t+Sgey2WmoM02hmtOyH+eOwO2dLCUSnYRtDBreZSs1NdjaLOJY052j hk00WF1VLPhqjvL6VYVHRCVDUk8GaMJu56fDxds7C0T4eTlxcF9O56xn/x4/EJ1RO+pQ Qt3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=Bmcrwu8g; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f10-20020ac85d0a000000b0041815039266si2364740qtx.262.2023.11.08.17.50.32 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 17:50:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=Bmcrwu8g; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFADF386189A for <ouuuleilei@gmail.com>; Thu, 9 Nov 2023 01:50:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by sourceware.org (Postfix) with ESMTPS id CB8563857C71 for <gcc-patches@gcc.gnu.org>; Thu, 9 Nov 2023 01:50:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB8563857C71 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CB8563857C71 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b2f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699494606; cv=none; b=BApQ88OLe+jHg/bdeCs116LVvdu5JMZxdzB0tVa7xexZeVaXJH1qbF3DAtAgKk1X/crcf/DfZmI/zCctAEkyZwsqu7GboVMfTUBHDy1LuZzitBbuMfVg9HbvSrTmLXaYS3KetuoPdpUNCIfJRGevWJOIxfcwCqHvXLDg2ZCA/yc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699494606; c=relaxed/simple; bh=2Kg5R2N+hSc0cUg6eLusqdJT/FaC7F9VJJZnV22wCbw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qYhPYsd9jjNSVUz5A2RVwoZU1/kKvMDpnwcFxCRC3siVFO7VW1xbj3tkzkU/HAVPL6nZvaICq4RC254Y/HY08br5+sq8u/dPra8427bg84iWDePCTbliKAvnWJpaKKB4/ckBK0dOiv+uQPTEvMEFZZyKR+nUC1VtDvxlBxVyiu4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb2f.google.com with SMTP id 3f1490d57ef6-da2b9234a9fso404229276.3 for <gcc-patches@gcc.gnu.org>; Wed, 08 Nov 2023 17:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1699494604; x=1700099404; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZtsKMiNZU4J7m+wuQb5gRIqsnM6kcDmK7MdNye/ZFNw=; b=Bmcrwu8g4uBPz4QgaGthK4C1u80aSuXRIUxpbkaFRC3sb2YKgMU9xdalUlbUteupsq 6I8ZGiX0EFp732fPbNcdTwQVnliwadh8/eaGRdLRWy6/Ve+26AP1MknldbWjjPF2ghsh 5rSyoR3cJd92ThxAWvklwfQPDk6bOIIN5Zky8Fe6yyICRrZnmN5bPT5fHERvrRBI9N4b FJLPHzFOxeBUhmOO9KjDRZHJob/Oor+VQLDXwaj6R0eI6moL+mBRNthiMDDXy1y/cpGa F8/xf38CEF8NCiAOmF72ch1YOAuBwXRby6cJ3WbkCUGzJsKAnLEVOkoKW1nqvGdq46br fpxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699494604; x=1700099404; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZtsKMiNZU4J7m+wuQb5gRIqsnM6kcDmK7MdNye/ZFNw=; b=C7pcolvbi6+o4w1qkjzQYyDD/+qLuAwptER9CtzA4EzfiUMhv8sllj1P1Ep4+7VTze q0JP+l20w+JN6XIKA9MZsUEk2zcptGYMbGztWv8kzLDMk8yYHSvlbubgMC0ZybCJX2Tn J17asPoVsfSKYRmALuvmqk8oqfHiCREeJlVsVT4/FvEpXm3dC2XOTvkV+C/hbezYKSmK WOtr2UkCQ3hmdf5vhYkO3jpX8QIrz4m68os0sTXmZq+RGSuaBoMxzrrhqO3FrQ06hZal Rs9cE0POYQS4XLTTG1f/F56z7o+dgd3z5rc+77ZjMb3jLE2yDsjdXGioiY9zWkGzdzsW Nbsw== X-Gm-Message-State: AOJu0YxZAgehDLc/EQbPiEffEZWHapbgN2lXMI7EwWeTewVC9Af4wVLn UnuzMgD/D6fyCwABJzwS2v8cmDjY4EBvXgn6MPhTZg== X-Received: by 2002:a0d:d597:0:b0:5a1:e4bf:ee5a with SMTP id x145-20020a0dd597000000b005a1e4bfee5amr3857846ywd.41.1699494603730; Wed, 08 Nov 2023 17:50:03 -0800 (PST) Received: from free.home ([2804:7f1:2080:e9c8:ff5e:88e8:a900:d7b4]) by smtp.gmail.com with ESMTPSA id i203-20020a0ddfd4000000b005af5ef0687fsm7605468ywe.6.2023.11.08.17.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 17:50:03 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3A91nl4l2231408 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 8 Nov 2023 22:49:48 -0300 From: Alexandre Oliva <oliva@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>, Mike Stump <mikestump@comcast.net> Subject: [PATCH] testsuite: tsan: add fallback overload for pthread_cond_clockwait Organization: Free thinker, does not speak for AdaCore Date: Wed, 08 Nov 2023 22:49:47 -0300 Message-ID: <orfs1fhf0k.fsf@lxoliva.fsfla.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782049283437609326 X-GMAIL-MSGID: 1782049283437609326 |
Series |
testsuite: tsan: add fallback overload for pthread_cond_clockwait
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Alexandre Oliva
Nov. 9, 2023, 1:49 a.m. UTC
LTS GNU/Linux distros from 2018, still in use, don't have pthread_cond_clockwait. There's no trivial way to detect it so as to make the test conditional, but there's an easy enough way to silence the fail due to lack of the function in libc, and that has nothing to do with the false positive that this is testing against. Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on i686- and x86_64-, on distros that offer and that lack pthread_cond_clockwait. Ok to install? for gcc/testsuite/ChangeLog * g++.dg/tsan/pthread_cond_clockwait.C: Add fallback overload. --- gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Comments
On Nov 8, 2023, at 5:49 PM, Alexandre Oliva <oliva@adacore.com> wrote: > > LTS GNU/Linux distros from 2018, still in use, don't have > pthread_cond_clockwait. There's no trivial way to detect it so as to > make the test conditional, but there's an easy enough way to silence > the fail due to lack of the function in libc, and that has nothing to > do with the false positive that this is testing against. > > Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on i686- and > x86_64-, on distros that offer and that lack pthread_cond_clockwait. Ok > to install? Ok.
diff --git a/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C b/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C index 82d6a5c8329ed..b43f3ebf80e2c 100644 --- a/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C +++ b/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C @@ -4,6 +4,19 @@ #include <pthread.h> +// This overloaded version should only be selected on targets that +// don't have a pthread_cond_clockwait in pthread.h, and it will wait +// indefinitely for the cond_signal that, in this testcase, ought to +// be delivered. +static inline int +pthread_cond_clockwait (pthread_cond_t *cv, + pthread_mutex_t *mtx, + __clockid_t, + void const /* struct timespec */ *) +{ + return pthread_cond_wait (cv, mtx); +} + pthread_cond_t cv; pthread_mutex_t mtx;