From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 38BD93858402 for ; Thu, 26 Aug 2021 11:52:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38BD93858402 Received: by mail-qv1-xf30.google.com with SMTP id v1so1801518qva.7 for ; Thu, 26 Aug 2021 04:52:37 -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=OiDi+Dmajq2FyofXQAzDyZnXz9MavL2zBBlaox7KSCI=; b=rNq02GQijhEBtF/i01Mca5ojuW+ZGeHyuyt2HM8Ps78jA/MHtXMHRCinrW9APejFq0 J0vn0UPsDXkCsSTWecVk8rkuJIxojIxU4CLZAYj8iw13ncVOE7zk0i3VK/uukHeoKdwn HueXXq3Ej2xl2yPKBUUtxCE88Ej2nj5Vc9xjmIS3GI2ma4pxeIgJugMykRzX7r449BL/ gqnXTm17e0NyvVdit5dK4pD9GbiWO4dT0sY90yfV8t4M0NG65YFFfOVB5EUHhtzL6mwh 82kjPk289T5qCifeRZ7Ska2ow0zTIekNfpnGORexVe4XgHaF+u4/3tHixdP9+edX2vRF zaZQ== X-Gm-Message-State: AOAM531/q92niF9xmZQueRvM9B21YNHnKuKkGk1j2G6alOFG0SMybK3l ZgGHG4ItCN3aMn9/EIVJwyYgaaQEJiKBcQ== X-Google-Smtp-Source: ABdhPJxmAKQC6nvQZUL2xHf9/0C/HPCiXX8ciGPLyH0TcquLdSoZoq2vn3y0YW2Fa8T6FITZH7lyjA== X-Received: by 2002:ad4:4b61:: with SMTP id m1mr3710317qvx.32.1629978756495; Thu, 26 Aug 2021 04:52:36 -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 g12sm2174935qkm.112.2021.08.26.04.52.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Aug 2021 04:52:36 -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> From: Adhemerval Zanella Message-ID: <79173390-c569-6362-7402-0c5211b719b1@linaro.org> Date: Thu, 26 Aug 2021 08:52:34 -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: <87pmu08s15.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:52:47 -0000 On 26/08/2021 06:38, Florian Weimer wrote: > * 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? Or I can't remove the aync test part and only test the deferred part, I don't have a strong opinion. > > Rest of the patch looks okay to me. > > Thanks, > Florian >