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.129.124]) by sourceware.org (Postfix) with ESMTPS id 44C87385800C for ; Wed, 4 Oct 2023 10:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 44C87385800C 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=1696416947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JQOvKIanLvgeZK4XAIL5O6E02Yb3Ajmfgg3GvFk3icA=; b=AN4HLj87M7F4qfUQ0LAYvMn5I95wcJyMTqtSZXmlNWZAvxS+TuVDLhL/+kZjoiN4aYOWKY M3Hz3DmlNO8t9Q33PC1fWRMgCXZf6IenOox8htHi/cks+yPo9XGeARhf61F8Igsr4s7n1F mdzHGoOFJWaYTuUIALWSB4T+ypKq0t8= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-WwR7XlZvM7iOdSSckRdC3Q-1; Wed, 04 Oct 2023 06:55:46 -0400 X-MC-Unique: WwR7XlZvM7iOdSSckRdC3Q-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9ae57d8b502so176287866b.2 for ; Wed, 04 Oct 2023 03:55:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696416945; x=1697021745; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JQOvKIanLvgeZK4XAIL5O6E02Yb3Ajmfgg3GvFk3icA=; b=qPG0XD1+Fu8mb/r3VYKv9YjTQ0ZmfHqf8nhMBFR7BI3HOGoxPN0p3aS2SkdZfW7Jcv 6deKtsKUopsK4/EkTo+dJNOj6hUlAXQ1dNpnNiIArEg5hogI7KUnlZxcMKtICLqOrt3e T3nNSafdHyJj2vqvDJ3qtskwrsSJ0fVPAUKeSMsi5EwffqGlgOszz7mLMi4Z9c2EhgPm +yAEtBzDTETdOyn16hT2rEIWymwksi5vDcEmfhc1w21crhNKFaS+rY6ZujULvL5XHeMs Xdk0+B8QXu+lNVrYcy7OAF6nX8avzGSarWxkMX6Z5NCGnW3beLKS7zEZMimIbAMRJC25 WirQ== X-Gm-Message-State: AOJu0YzpgB4UZmC3PFoaXkT2zmipKEQteS4JI9y8wvaelFbkO3c7zUYp IGC37nHlFBNltyFJScYbIpY8Ql3+SFHScRqdMulJKbKa7S+l6Vk3T7obZfpKxPzX8iihM+Mo1r0 kaGfIWmzcqRtVZJ7UnyYWLQ== X-Received: by 2002:a17:906:109e:b0:9b2:f38d:c44a with SMTP id u30-20020a170906109e00b009b2f38dc44amr1304382eju.73.1696416945368; Wed, 04 Oct 2023 03:55:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPF0d36ctA2inNRKxRjQ8TRGGHbs8Nrd0aEENLJQo0iKpIdJ63yetv9nauPe9WEcGRBjBuBA== X-Received: by 2002:a17:906:109e:b0:9b2:f38d:c44a with SMTP id u30-20020a170906109e00b009b2f38dc44amr1304375eju.73.1696416945052; Wed, 04 Oct 2023 03:55:45 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id n3-20020a170906088300b009a5f1d1564dsm2581852eje.126.2023.10.04.03.55.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 03:55:40 -0700 (PDT) Message-ID: <82422697-8aa9-d56a-8aa0-2c60703d5276@redhat.com> Date: Wed, 4 Oct 2023 12:55:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] process-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20230929175313.24845-1-thiago.bauermann@linaro.org> From: Guinevere Larsen In-Reply-To: <20230929175313.24845-1-thiago.bauermann@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 29/09/2023 19:53, Thiago Jung Bauermann via Gdb-patches wrote: > I'm seeing a lot of variability in the failures of > gdb.threads/process-dies-while-detaching.exp on aarch64-linux. On this > platform, a problem yet to be investigated causes GDB to miss the _exit > breakpoint. What happens next is random because after missing that > breakpoint, GDB is out of sync with the inferior. This causes the tests > following that point in the testcase to fail in a random way. > > In this scenario it's better to exit the testcase early to avoid random > results in the testsuite. Thanks for working on this test, it has been driving me up the wall for a while! > > We are relying on gdb_continue_to_breakpoint to return the result of > gdb_test_multiple. This is already the case because in Tcl the return > value of a function is the return value of the last command it runs. But > change gdb_continue_to_breakpoint to explicitly return this value, to make > it clear this is the intended behaviour. I like this change, since I didn't actually know that this was TCL's behavior! > > Tested on aarch64-linux. I tested on x86_64 and I see no regressions. Tested-By: Guinevere Larsen I hope this gets approved soon! -- Cheers, Guinevere Larsen She/Her/Hers > --- > .../gdb.threads/process-dies-while-detaching.exp | 10 +++++----- > gdb/testsuite/lib/gdb.exp | 4 ++-- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp > index bbbe82df30cd..c7d43d7dddcc 100644 > --- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp > +++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp > @@ -127,7 +127,7 @@ proc detach_and_expect_exit {inf_output_re test} { > > proc continue_to_exit_bp {} { > gdb_breakpoint "_exit" temporary > - gdb_continue_to_breakpoint "_exit" ".*_exit.*" > + return [gdb_continue_to_breakpoint "_exit" ".*_exit.*"] > } > > # If testing single-process, simply detach from the process. > @@ -226,7 +226,7 @@ proc test_detach {multi_process cmd} { > } > > # Run to _exit in the child. > - continue_to_exit_bp > + return_if_fail [continue_to_exit_bp] > > do_detach $multi_process $cmd "normal" > } > @@ -265,13 +265,13 @@ proc test_detach_watch {wp multi_process cmd} { > # them out, and handle the case of the thread disappearing > # while doing that (on targets that need to detach from each > # thread individually). > - continue_to_exit_bp > + return_if_fail [continue_to_exit_bp] > } else { > # Force software watchpoints. > gdb_test_no_output "set can-use-hw-watchpoints 0" > > # As above, but flip order, other wise things take too long. > - continue_to_exit_bp > + return_if_fail [continue_to_exit_bp] > gdb_test "watch globalvar" "Watchpoint $decimal: globalvar" > > if { $multi_process == 0 && $cmd == "continue" } { > @@ -304,7 +304,7 @@ proc test_detach_killed_outside {multi_process cmd} { > } > > # Run to _exit in the child. > - continue_to_exit_bp > + return_if_fail [continue_to_exit_bp] > > set childpid [get_integer_valueof "mypid" -1] > if { $childpid == -1 } { > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 1b9179401c45..dfabc99fe4be 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -822,14 +822,14 @@ proc gdb_continue_to_breakpoint {name {location_pattern .*}} { > set full_name "continue to breakpoint: $name" > > set kfail_pattern "Process record does not support instruction 0xfae64 at.*" > - gdb_test_multiple "continue" $full_name { > + return [gdb_test_multiple "continue" $full_name { > -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" { > pass $full_name > } > -re "(?:$kfail_pattern)\r\n$gdb_prompt $" { > kfail "gdb/25038" $full_name > } > - } > + }] > } > > >