From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-5.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2B1D71F8C6 for ; Thu, 26 Aug 2021 17:50:04 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 493AE385842B for ; Thu, 26 Aug 2021 17:50:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 493AE385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1630000203; bh=XHjI5ITxNXvok+nrZn5mQ/4lqB1/1Y6bDW+7g6SKrRs=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pyxpD5BbmQCfbyrhLNVQL8Wktj99QWH+kV0+M/TLzvWcCYOdWkRxPjpMPiMD09i49 abWYYN6LQFKjHe2v6vnvIJ85tkPfgA6mWWJpJ7bsI7OlU0KJ5+8LHqNMtEF0P6xmV0 RBaZlwGLckNDyMrOSu+HX2uM/XlgV8U6zVF7EDOo= Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id 10FF63858D3C for ; Thu, 26 Aug 2021 17:49:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10FF63858D3C Received: by mail-qt1-x834.google.com with SMTP id r21so3157373qtw.11 for ; Thu, 26 Aug 2021 10:49:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XHjI5ITxNXvok+nrZn5mQ/4lqB1/1Y6bDW+7g6SKrRs=; b=dcoIdeqJFJZoSoDGQm1nDsGonOAAemr5szxmiqu7WWtABOkFExdg58iUOJQUNXYvtd zOuU/lfnDahmKfMhlyUQcGczj3dB5WR6DU656cPhnk8exwdh0zMYVxTb0BoUuCO/B4Sz GmN3CxoSvep7Aa/nR18xmXxzmnZ93RynQWMLDFbcx6ZV2nKGncRb7K430etwSkO7j3hM M/tydkXlwgji0gg0HJT0bN9PnHMY0ahIwgOLBJKqiAnk+1JxjOg2vnd37MliccFrIR8E rc+ucWbZgRiI3iizHwOHTOsVtaZ26REBWSuzNNBF9H+ave9eyJh3htKeyWZkZHI2hbRa R37g== X-Gm-Message-State: AOAM530mQt5NahCRp3gMp+MCJnsVOoE/MNZA85nrntbXi+u3aG+A0uII 415mmT+sS7Btq4q0EHpWhH/5QVpJuZv0gg== X-Google-Smtp-Source: ABdhPJyb6KZPc1XUSnuvrQjho6S8HRYBNlETAWPQWenraG7UWRv5YprSGUAdaW027Ze8vWaGJRY5pw== X-Received: by 2002:a05:622a:2cc:: with SMTP id a12mr4444767qtx.115.1630000174512; Thu, 26 Aug 2021 10:49:34 -0700 (PDT) Received: from ?IPv6:2804:431:c7ca:1a68:4e82:9e7c:b7e4:7f3? ([2804:431:c7ca:1a68:4e82:9e7c:b7e4:7f3]) by smtp.gmail.com with ESMTPSA id f3sm2288451qti.65.2021.08.26.10.49.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Aug 2021 10:49:34 -0700 (PDT) Subject: Re: [PATCH v2 17/19] nptl: Use tidlock when accessing TID on pthread_sigqueue To: Florian Weimer References: <20210823195047.543237-1-adhemerval.zanella@linaro.org> <20210823195047.543237-18-adhemerval.zanella@linaro.org> <87eeag5ksb.fsf@oldenburg.str.redhat.com> Message-ID: Date: Thu, 26 Aug 2021 14:49:32 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87eeag5ksb.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 26/08/2021 11:43, Florian Weimer wrote: > * Adhemerval Zanella: > >> + /* Block all signal, since the lock is recursive and used on pthread_cancel >> + (which should be async-signal-safe). */ >> + sigset_t oldmask; >> + __libc_signal_block_all (&oldmask); >> + lll_lock (pd->tidlock, LLL_PRIVATE); >> + >> + int res; >> + if (pd->tid == 0) >> + { >> + pid_t pid = getpid (); > > Huh, that can't be right, should be pd->tid != 0. > It is definitely not, I have fixed. > Don't we have test coverage for this? Nops, I will add one in the next version. > >> + else >> + res = -ESRCH; > > We can return 0 in this case, I think. No sure about this, we can return 0 but it means signal won't be potentially delivered. > > It's possibly that the same issue regarding synchronous signal delivery > for pthread_jill applies here. > > Thanks, > Florian >