From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 576D53858C30 for ; Thu, 1 Jun 2023 09:32:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 576D53858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685611975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ccyb/vb43dHKzp91mbEEWqJ9gcC8xEOp2e31ldQluac=; b=F/aAUqftCAAWdRsu8MfNNvkBi19tOwihfbbXMAUu9ySTKkkmONHxqx+SLvOUurRdHAOrCe ahV/XVoVrwyZdmhJCmT7m8iL8GCdYHl+AP05w+4SvM5/3/jthJS1j5iOgvydgxdrWazodF TkR4L46NhWGryk6oZ4/Lvym4OAy7rBk= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-UvFerkAqMu-m4DQe1x17yg-1; Thu, 01 Jun 2023 05:32:36 -0400 X-MC-Unique: UvFerkAqMu-m4DQe1x17yg-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b10d017ea0so5318621fa.3 for ; Thu, 01 Jun 2023 02:32:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685611955; x=1688203955; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ccyb/vb43dHKzp91mbEEWqJ9gcC8xEOp2e31ldQluac=; b=V7gcCJLHY0CCp9Mc111/5kAIoQ1d6Lc6CoH0shMPmh98FV4MomaE4Nyr7/eoeGzcAu Y+LHF5Yrg3z1Ea91SggLaTZOOKVienQi5OQ/1BDCql/2HwtAz/izPBNYihU1cqHLIROc /+ptG7aM52b3KY2blWn+BfrmJnBRis83kPKOcTEni7cMvlIDY0/78DYZQQVGY8CabDs9 +hfb49q4HnpZBhiYGG4URAQhTVewas5rOmkCI+fqX/jTjBZ9XzpaAUAloy8wzmA5lGMO wL78YVOAbOGbq+SKcBjAwQ7nC+DiIT5RQ4sfnsOTys/NIcq4aCrfEbpvjai9jd7A6SzJ qpbQ== X-Gm-Message-State: AC+VfDxTGO2t+xjMccwF/Lld+5XvJIv7VDj0ngj3dWZJ2tv9Oco4TUQa gIVd9XjEYs1yqOAgUdE2ws8KuwwH3d0j8VP0OswobUkYM8lpEz24xKckoM1RjkYhI6B/kq1XWlG +jUwYveGblK8WSPpeHhhom9u5pCvzE705Dix1Nip1WGhhZbREeqOPno8tD2Ziv9HwJmLdV6p9Fw XxAOv50w== X-Received: by 2002:a2e:9884:0:b0:2ad:81ca:a52f with SMTP id b4-20020a2e9884000000b002ad81caa52fmr4447865ljj.47.1685611955219; Thu, 01 Jun 2023 02:32:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fwErDWwtce8K7wy2EJOuHwr5q9Pv8pYXdx4r96HnR0fab27nSA14XfPJV3ClhLpy2oNZ5pw== X-Received: by 2002:a2e:9884:0:b0:2ad:81ca:a52f with SMTP id b4-20020a2e9884000000b002ad81caa52fmr4447850ljj.47.1685611954819; Thu, 01 Jun 2023 02:32:34 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id g26-20020a7bc4da000000b003f50e88ffc1sm1722754wmk.0.2023.06.01.02.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 02:32:34 -0700 (PDT) From: Andrew Burgess To: Thiago Jung Bauermann via Gdb-patches , gdb-patches@sourceware.org Cc: Thiago Jung Bauermann Subject: Re: [PATCH] gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp In-Reply-To: <20230531200602.165033-1-thiago.bauermann@linaro.org> References: <20230531200602.165033-1-thiago.bauermann@linaro.org> Date: Thu, 01 Jun 2023 10:32:33 +0100 Message-ID: <87zg5j4jf2.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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 List-Id: Thiago Jung Bauermann via Gdb-patches writes: > This testcase sometimes gets stuck in a loop for hours when running in our > CI. The problem is that due to an issue unrelated to reverse debugging the > inferior exits early, and because of the overly generic ".*" pattern the > testcase keeps sending the "next" command without noticing that the > inferior is gone. > > gdb_test_multiple has a pattern to detect that "The program is not being > run.", but since it is placed after the patterns from the caller it won't > be triggered. It also has a timeout pattern, but for some reason I don't > understand it often doesn't trigger. The timeout is triggered between successful matches. So each time the test matches the '-re -wrap ".*"' this counts as a successful match and the timeout is reset. Thanks, Andrew > > Since the test binary is compiled with debug information, fix by changing > the pattern to match the source code line number that is shown by GDB right > after the "step" command. > --- > gdb/testsuite/gdb.reverse/step-reverse.exp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp > index 729218d4cb8c..766ca02910af 100644 > --- a/gdb/testsuite/gdb.reverse/step-reverse.exp > +++ b/gdb/testsuite/gdb.reverse/step-reverse.exp > @@ -261,7 +261,7 @@ if { "$step_out" == 1 } { > -re -wrap "NEXT OVER THIS RECURSION.*" { > set step_out 0 > } > - -re -wrap ".*" { > + -re -wrap "^\[0-9\].*" { > send_gdb "next\n" > exp_continue > } > @@ -286,7 +286,7 @@ gdb_test_multiple "next" "step over recursion inside the recursion" { > gdb_assert {"$seen_recursive_call" == 1} \ > "step over recursion inside the recursion" > } > - -re -wrap ".*" { > + -re -wrap "^\[0-9\].*" { > send_gdb "next\n" > exp_continue > }