From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id 3B4C73858D1E for ; Wed, 13 Jul 2022 21:32:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B4C73858D1E 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-f45.google.com with SMTP id l68so7269617wml.3 for ; Wed, 13 Jul 2022 14:32:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OZDiTbgdk5MAX3/V+TTpAX7lBviDijwVfanI7unCkR0=; b=Q6I7aDi05huP9TsLOe5jLGymv9xkr/vBaJW46s3+T1CYwowEhFxnIbuzlJXkslU+3s 9xnCqoAA8s6e54NbANke0OHvEQ24xEcJJ9qKGPdqaeW1bohAxOBJYapfqeVyuKnYBcci AT8Sa9uwToSwqpC3jV//UzAACFNzmQrem2/5o575yywD0N4t2UmRLs131CYBJK3KjgGJ QiJfVvv2DY9LI9DTY9a2NqgARpY5wwNkOdJgFoPpp++SANRvvjWeo8b43Szf44jxsS5A 7H8rk2N54URZqqs7EKjUfA5bECQnxhDQ8YgSW+6L/emQx2147qee+PfnSMyx80cHRU7O X0rw== X-Gm-Message-State: AJIora+ouPI+BUrYp5cDOD6nIbNSm8+IlTo7JL1ON3Ya5SjOL8rJhC5s 8ega02Hd0hPve9JkojWNF/0+0MruK8s= X-Google-Smtp-Source: AGRyM1u6pWM55I/MQVmg++KWVdlkCn3SikJ4quCoCLYHar89IzIyzfuBIPiRY17RpyzTBNpGUO7BKg== X-Received: by 2002:a05:600c:3546:b0:3a1:861d:e75a with SMTP id i6-20020a05600c354600b003a1861de75amr11870274wmq.58.1657747945021; Wed, 13 Jul 2022 14:32:25 -0700 (PDT) Received: from ?IPv6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id n17-20020a05600c3b9100b003a2d92ab521sm3683424wms.26.2022.07.13.14.32.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jul 2022 14:32:24 -0700 (PDT) Subject: Re: [PATCH 20/25] Tighten gdb.threads/no-unwaited-for-left.exp regexps From: Pedro Alves To: gdb-patches@sourceware.org References: <20220620225419.382221-1-pedro@palves.net> <20220620225419.382221-21-pedro@palves.net> Message-ID: <72433b9c-f4b2-c22f-9566-1c15d25167f6@palves.net> Date: Wed, 13 Jul 2022 22:32:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220620225419.382221-21-pedro@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, 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: Wed, 13 Jul 2022 21:32:29 -0000 This one is I think pretty much unobjectionable, so I went ahead and merged it, to avoid reposting it in a v2 of the series. (I replaced the "following patch" wording in the commit log.) Pedro Alves On 2022-06-20 11:54 p.m., Pedro Alves wrote: > 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 >