From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SIIcEcK4OWNdPwQAWB0awg (envelope-from ) for ; Sun, 02 Oct 2022 12:13:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 3A3421E112; Sun, 2 Oct 2022 12:13:54 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=lists.lttng.org header.i=@lists.lttng.org header.a=rsa-sha256 header.s=default header.b=cuUZkb/h; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.lttng.org (lists.lttng.org [167.114.26.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7A12C1E0D5 for ; Sun, 2 Oct 2022 12:13:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.lttng.org; s=default; t=1664727233; bh=VnF4u7YJjTv1CHkWAGEDJVgHBXkzk4TXaW2CGyePr30=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cuUZkb/hK0eWbSiGONcSBE3q5JWLHDarZjDCD7oEslpM9kAkeU0NoCe+ojAeUtSpo k/Wl7TLCkem1lRu9ANRCjeFT8bcw3bqsNLV4aEty1PbJQATzk3MdMMiphEg9dgqais Xi20KVnSng+zJfOrOq9pZJKwmSahsZlNNWbfTbBU3gZWW9DG24p713YG3X2CqeCqq3 f01oR5wzI4udMz+ToGotdp9Vj1ZY+L07tuHix3NLhXQshu62oy++JQxa2TaPR1FnQw TvzblQnZRaL9KsIzPgbkb6qOVtddIRZiMz1Gs2bHguxJh/TVDHr8ISlPaKR5Il5ORu M04rfFVnvizHQ== Received: from lists-lttng01.efficios.com (localhost [IPv6:::1]) by lists.lttng.org (Postfix) with ESMTP id 4MgTYD59zPz27xn; Sun, 2 Oct 2022 12:13:52 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [173.255.242.215]) by lists.lttng.org (Postfix) with ESMTPS id 4MgTYC1hr0z27xm for ; Sun, 2 Oct 2022 12:13:51 -0400 (EDT) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C31BD1F51E for ; Sun, 2 Oct 2022 16:13:43 +0000 (UTC) To: lttng-dev@lists.lttng.org Date: Sun, 2 Oct 2022 16:13:43 +0000 Message-Id: <20221002161343.854582-1-normalperson@yhbt.net> MIME-Version: 1.0 Subject: [lttng-dev] [PATCH] always check pthread_create for failures X-BeenThere: lttng-dev@lists.lttng.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: LTTng development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eric Wong via lttng-dev Reply-To: Eric Wong Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: lttng-dev-bounces@lists.lttng.org Sender: "lttng-dev" pthread_create may fail with EAGAIN (which is no fault of the programmer), so don't allow the check to be compiled out. Signed-off-by: Eric Wong --- src/urcu-defer-impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index 1c96287..cbb0ca8 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -417,7 +417,8 @@ static void start_defer_thread(void) urcu_posix_assert(!ret); ret = pthread_create(&tid_defer, NULL, thr_defer, NULL); - urcu_posix_assert(!ret); + if (ret) + urcu_die(ret); ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); urcu_posix_assert(!ret); _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev