From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 51C1B3858415 for ; Thu, 26 Aug 2021 11:56:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 51C1B3858415 Received: by mail-qk1-x72a.google.com with SMTP id 14so2981711qkc.4 for ; Thu, 26 Aug 2021 04:56:38 -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=bpR9LhzaASbvH5KOtalhCJ4NyQFe5oGGNc76CW60gxk=; b=h8NdqbeZ5HpNiMs7uX5ECpOofONFNPo13VqJ1qWVLvDLf1OKwbNo3cErjYqF2b9LLn 4nxZ/w+a/nLLapvSIGoWfjClaRY82pLUkhdryWX7QHzgMFNwgQthaJ//JpIEEwQZQ2HN qkYOUb3bhD2YU/WrF0x18DXRa4GqIBrY6An/ifHC3TBfdzK7nX0YVpyKOASanC/Mvp5s JEdc3aLliwQWRdV6K891CLaAB2U3fK5Hb3FRW2KWjsY/H5YIoD9Qfr+semjvXW9DeEhh jhacfl6RVtYLEs8eEcQHOC4nQpaE5qyZoVHSFu3g3s8AT6AbzyDP7Y1cXKXoEQynOjdc VG5g== X-Gm-Message-State: AOAM531U9SIwrwPdjdT5dky6o1NoANPcF3GHA9AAnCdGFkUYPdNnyY80 GIqzR6r131Vdr+NT4Ik9pdad6/NDN8nmzQ== X-Google-Smtp-Source: ABdhPJxuDvRkUV/Z2xYFnKHSv+Ms7qISv+ot5X5PSZ0TL5uKtMoPOYhjcS3IYOBpaDemMfpY+ogFBQ== X-Received: by 2002:a05:620a:1aa7:: with SMTP id bl39mr3426580qkb.304.1629978997752; Thu, 26 Aug 2021 04:56:37 -0700 (PDT) Received: from ?IPv6:2804:431:c7ca:1a68:4988:5e6e:21a3:3c6b? ([2804:431:c7ca:1a68:4988:5e6e:21a3:3c6b]) by smtp.gmail.com with ESMTPSA id t8sm1647138qtn.37.2021.08.26.04.56.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Aug 2021 04:56:37 -0700 (PDT) Subject: Re: [PATCH v2 02/19] nptl: Set cancellation type and state on pthread_exit To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20210823195047.543237-1-adhemerval.zanella@linaro.org> <20210823195047.543237-3-adhemerval.zanella@linaro.org> <87pmu08s15.fsf@oldenburg.str.redhat.com> <87h7fc8ru7.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: Date: Thu, 26 Aug 2021 08:56:35 -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: <87h7fc8ru7.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 26 Aug 2021 11:56:48 -0000 On 26/08/2021 06:42, Florian Weimer wrote: > * Florian Weimer: > >> * Adhemerval Zanella: >> >>> +/* Check if a thread with PTHREAD_CANCEL_ASYNCHRONOUS cancellation on >>> + blocked read() sets the correct state and type as pthread_exit. */ >>> +static void * >>> +tf_cancel_async (void *arg) >>> +{ >>> + TEST_VERIFY (pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL) >>> + == 0); >>> + >>> + xpthread_barrier_wait (&b); >>> + >>> + pthread_cleanup_push (clh, NULL); >> >> This assumes that pthread_cleanup_push is async-cancel-safe. According >> to this thread: >> >> Async cacellation and pthread_cleanup_push >> >> >> this is not always true. >> >> Should we build this test with -fno-exceptions? >> >> Rest of the patch looks okay to me. > > And this should probably reference a Bugzilla bug. I have opened https://sourceware.org/bugzilla/show_bug.cgi?id=28267