From patchwork Wed Sep 20 17:59:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 76462 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9577D385CC99 for ; Wed, 20 Sep 2023 18:00:56 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by sourceware.org (Postfix) with ESMTPS id 4FF73385609B for ; Wed, 20 Sep 2023 18:00:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FF73385609B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40479f8325fso1013395e9.1 for ; Wed, 20 Sep 2023 11:00:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695232825; x=1695837625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZVd4QZGBrKDQMNVGnounjmS2yyR1kuviGe/lzx4L2wk=; b=r+bJryQKgfjQ0Jksmhbk0Ugxpb5IYykPiw2ILTrsg9wiShYJyUQ7+6PvwRA6Y68QoZ 4yxnXER7VOOeVWvTvEuOb5aNzsGazUmKSxTL1idRbp7wOqRJm07AbFEnLoNvcug8+rEz BVnp5fAKv0GAdJ2byv2rCuLOc0AewL2+9PeQWT8PcRE4dUnf5pFfopJqc5o7WoiIFjc/ IB69h03c0HyPUvHEzPuZMgngeC+Zkb/Iru3ih9rp3hkOPtot0aSheOLoOILYrbIg/Vsu jGyhuCggL29FHdpFnd+VIQJ23wkyIgIqvn5VGiTzbFBPtWb7fi5VCCg+LBdMH87E6wzO 4V+A== X-Gm-Message-State: AOJu0YzkR5CKAvn4nipizWYMVQxCIANKxo6EUanbNkyWFcbrkgNl0YwW V6crzmPopUo6z/QojzZkj7N15uMC4rT5OQ== X-Google-Smtp-Source: AGHT+IEX35US7WPAoyiPidrToewfWK35WJ1Itl2HdPWRR0erovAe9CTQMCSnf7sGHTBzsJ+dAMVORQ== X-Received: by 2002:a05:600c:d6:b0:401:b1c6:97e8 with SMTP id u22-20020a05600c00d600b00401b1c697e8mr3222654wmm.36.1695232824813; Wed, 20 Sep 2023 11:00:24 -0700 (PDT) Received: from localhost ([2001:8a0:f939:d200:f66d:9e3b:9c38:4aec]) by smtp.gmail.com with UTF8SMTPSA id g17-20020a7bc4d1000000b00401c595fcc7sm2585251wmk.11.2023.09.20.11.00.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 11:00:24 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 4/5] In gdb.threads/pthreads.c, handle pthread_attr_setscope ENOTSUP Date: Wed, 20 Sep 2023 18:59:58 +0100 Message-Id: <20230920175959.2305271-5-pedro@palves.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920175959.2305271-1-pedro@palves.net> References: <20230920175959.2305271-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" On Cygwin, I see: (gdb) PASS: gdb.threads/pthreads.exp: break thread1 continue Continuing. pthread_attr_setscope 1: Not supported (134) [Thread 3732.0x265c exited with code 1] [Thread 3732.0x2834 exited with code 1] [Thread 3732.0x2690 exited with code 1] Program terminated with signal SIGHUP, Hangup. The program no longer exists. (gdb) FAIL: gdb.threads/pthreads.exp: Continue to creation of first thread ... and then a set of cascading failures. Fix this by treating ENOTSUP the same way as if PTHREAD_SCOPE_SYSTEM were not defined. I.e., ignore ENOTSUP errors, and proceed with testing. Change-Id: Iea68ff8b9937570726154f36610c48ef96101871 --- gdb/testsuite/gdb.threads/pthreads.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c index 547bf0fe3f0..4b8b283b048 100644 --- a/gdb/testsuite/gdb.threads/pthreads.c +++ b/gdb/testsuite/gdb.threads/pthreads.c @@ -24,6 +24,7 @@ #include #include #include +#include static int verbose = 0; @@ -135,7 +136,7 @@ main (int argc, char **argv) #ifdef PTHREAD_SCOPE_SYSTEM res = pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM); - if (res != 0) + if (res != 0 && res != ENOTSUP) { print_error ("pthread_attr_setscope 1", res); exit (1);