From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 27C10384144A for ; Mon, 20 Jun 2022 22:55:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 27C10384144A 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-wr1-f42.google.com with SMTP id i10so12750167wrc.0 for ; Mon, 20 Jun 2022 15:55:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w2ryCdL7XDesyzPcDrKA6sYaNYxSbE3jnI6g5+XC+6E=; b=NgFyBepQjGen8oyI3UNqXapXJ4cILsOTRyUdDgfqkeQWadnYv2f+HzfZycC6+vcWCR pD3o9QQBj2LAuEOmemUbct12zKO7J+QAouKEn6NCERvT6wRTRVOrLPt/QsgpnhNQYUxf 8AlTPsXUgw7dlVYcTHDq8h8t9IQTNdFSAOP6FMi+KKVh05pbe8rdPz0StqHpMvlSikDS nO3Tb3Xh7RuNoaBKSuP+AENd68x9BXGfwGuD3Xt4RGPabUSVBzWzHKNUVk887Ljq832p 9nGMFlhOqWbnyFjnzc6+SSZTeOt0UQYSVx60g3nKwBUNSAF1eCkTcLkjUVzYq++B5vXN Gvzw== X-Gm-Message-State: AJIora9MbBq8+mXr3kuHdSfdq+Elpv6fzR/sXVLWJd0jCB5Aad2y/dVm SldI1B+lwZ+6PFKJGtnREUMQvKZ0JaA= X-Google-Smtp-Source: AGRyM1s0nePwQnRj1EYW4mbxnpYK4ji1NFzxvq16zFg6qADeLMkYruCxES3qrJFC2YIThet4A9CWSA== X-Received: by 2002:adf:df06:0:b0:21b:8c99:e7ce with SMTP id y6-20020adfdf06000000b0021b8c99e7cemr9394138wrl.568.1655765705402; Mon, 20 Jun 2022 15:55:05 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id u3-20020adfeb43000000b0021a34023ca3sm14200955wrn.62.2022.06.20.15.55.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jun 2022 15:55:04 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 20/25] Tighten gdb.threads/no-unwaited-for-left.exp regexps Date: Mon, 20 Jun 2022 23:54:14 +0100 Message-Id: <20220620225419.382221-21-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220620225419.382221-1-pedro@palves.net> References: <20220620225419.382221-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.8 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, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2022 22:55:08 -0000 A WIP version of the following patch resulted in a bug that went unnoticed by the testuite, like so: (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: enable scheduler-locking, for main thread continue Continuing. [New Thread 1251861.1251861] No unwaited-for children left. (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits info threads Id Target Id Frame 3 Thread 1251861.1251863 "no-unwaited-for" __pthread_clockjoin_ex (threadid=140737351558976, thread_return=0x0, clockid=, abstime=, block=) at pthread_join_common.c:145 4 Thread 1251861.1251861 "no-unwaited-for" in ?? () The current thread has terminated. See `help thread'. (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: only thread 3 left, main thread terminated Somehow, above, GDB re-added the zombie leader back before printing "No unwaited-for children left.". The "only thread 3 left, main thread terminated" test should have caught this, but didn't. That is because the test's regexp has a ".*" after the part that matches thread 3. This commit tightens that regexp to catch such a bug. It also tightens the "only main thread left, thread 2 terminated" test's regexp in the same way. Change-Id: I8744f327a0aa0e2669d1ddda88247e99b91cefff --- gdb/testsuite/gdb.threads/no-unwaited-for-left.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp b/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp index cfeb495594d..6773aa46d71 100644 --- a/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp +++ b/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp @@ -42,7 +42,7 @@ gdb_test "continue" \ "continue stops when thread 2 exits" gdb_test "info threads" \ - "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thread \[^\r\n\]* \[^\r\n\]*.*The current thread has terminated.*" \ + "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thread \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread has terminated.*" \ "only main thread left, thread 2 terminated" # Select the main thread, let the third thread start, and stop at the @@ -63,7 +63,7 @@ gdb_test "continue" \ "continue stops when the main thread exits" gdb_test "info threads" \ - "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thread \[^\r\n\]* \[^\r\n\]*.*The current thread has terminated.*" \ + "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thread \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread has terminated.*" \ "only thread 3 left, main thread terminated" # Make sure thread apply all works when we have exited threads in the -- 2.36.0