From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id H/xsESKakmC1AgAAWB0awg (envelope-from ) for ; Wed, 05 May 2021 09:14:10 -0400 Received: by simark.ca (Postfix, from userid 112) id 39B6F1F11C; Wed, 5 May 2021 09:14:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E2A491E54D for ; Wed, 5 May 2021 09:14:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71C5339A6051; Wed, 5 May 2021 13:14:07 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id E7AEB385782F for ; Wed, 5 May 2021 13:14:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7AEB385782F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 155D4AE86 for ; Wed, 5 May 2021 13:14:05 +0000 (UTC) Date: Wed, 5 May 2021 15:14:01 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix timeout in gdb.threads/detach-step-over.exp with readnow Message-ID: <20210505131356.GA26308@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.threads/detach-step-over.exp with target board readnow, I run into: ... Reading symbols from /lib64/libc.so.6...^M Reading symbols from \ /usr/lib/debug/lib64/libc-2.26.so-2.26-lp152.26.6.1.x86_64.debug...^M Expanding full symbols from \ /usr/lib/debug/lib64/libc-2.26.so-2.26-lp152.26.6.1.x86_64.debug...^M FAIL: gdb.threads/detach-step-over.exp: \ breakpoint-condition-evaluation=host: target-non-stop=on: non-stop=on: \ displaced=off: iter 2: attach (timeout) ... Fix this by doing exp_continue when encountering the "Reading symbols" or "Expanding full symbols" lines. This is still fragile and times out with a higher load, similated f.i. by stress -c 5. Fix that by using a timeout factor of 2. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix timeout in gdb.threads/detach-step-over.exp with readnow gdb/testsuite/ChangeLog: 2021-05-05 Tom de Vries * gdb.threads/detach-step-over.exp: Do exp_continue when encountering "Reading symbols" or "Expanding full symbols" lines. Using timeout factor of 2 for attach. --- gdb/testsuite/gdb.threads/detach-step-over.exp | 49 +++++++++++++++++--------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/gdb.threads/detach-step-over.exp b/gdb/testsuite/gdb.threads/detach-step-over.exp index 8c58aebad8a..27718551188 100644 --- a/gdb/testsuite/gdb.threads/detach-step-over.exp +++ b/gdb/testsuite/gdb.threads/detach-step-over.exp @@ -106,23 +106,38 @@ proc test {condition_eval target_non_stop non_stop displaced} { with_test_prefix "iter $attempt" { gdb_test "inferior 1" "Switching to .*" - set attached 0 - set eperm 0 - set test "attach" - gdb_test_multiple "attach $testpid" $test { - -re "new threads in iteration" { - # Seen when "set debug libthread_db" is on. - exp_continue - } - -re "is a zombie - the process has already terminated.*$gdb_prompt " { - fail $gdb_test_name - } - -re "Unable to attach: .*$gdb_prompt " { - fail $gdb_test_name - } - -re "Attaching to program.*process $testpid.*$gdb_prompt " { - pass $test - set attached 1 + with_timeout_factor 2 { + set attached 0 + set saw_attaching 0 + set eperm 0 + set test "attach" + gdb_test_multiple "attach $testpid" $test { + -re "Attaching to program.*process $testpid\r\n" { + set saw_attaching 1 + exp_continue + } + -re "new threads in iteration" { + # Seen when "set debug libthread_db" is on. + exp_continue + } + -re "Reading symbols from|Expanding full symbols from" { + # Prevent -readnow timeout. + exp_continue + } + -re "is a zombie - the process has already terminated.*$gdb_prompt " { + fail $gdb_test_name + } + -re "Unable to attach: .*$gdb_prompt " { + fail $gdb_test_name + } + -re "\r\n$gdb_prompt " { + if { $saw_attaching } { + set attached 1 + pass $test + } else { + fail $test + } + } } }