From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 31FFC3857036 for ; Wed, 7 Apr 2021 04:16:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31FFC3857036 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 4373FAFF4; Wed, 7 Apr 2021 04:16:32 +0000 (UTC) Date: Wed, 7 Apr 2021 06:16:30 +0200 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org Subject: [committed][testsuite] Fix handling of missing section in smaller-than.sh Message-ID: <20210407041629.GA27564@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-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 04:16:35 -0000 Hi, On openSUSE Tumbleweed I run into: ... Running testsuite/dwz.tests/dwz-tests.exp ... testsuite/scripts/smaller-than.sh: line 18: 16#: \ invalid integer constant (error token is "16#") ... FAIL: testsuite/dwz.tests/dwz.sh ... The relevant line in smaller-than.sh is: ... s=$(printf "%d" $((16#$s))) ... This seems to be due bash (version 5.1.4), which gives: ... $ echo $((16#)) bash: 16#: invalid integer constant (error token is "16#") ... while bash on Leap 15.2 (version 4.4.23) gives: ... $ echo $((16#)) 0 ... Fix this by explicitly handling s == "" in proc section_size. Committed to trunk. Thanks, - Tom [testsuite] Fix handling of missing section in smaller-than.sh 2021-04-07 Tom de Vries PR dwz/27694 * testsuite/scripts/smaller-than.sh (section_size): Handle s == "". --- testsuite/scripts/smaller-than.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testsuite/scripts/smaller-than.sh b/testsuite/scripts/smaller-than.sh index ab06e3a..3b452dc 100755 --- a/testsuite/scripts/smaller-than.sh +++ b/testsuite/scripts/smaller-than.sh @@ -14,6 +14,11 @@ section_size () | sed 's/.*\.debug_//' \ | awk '{print $5}') + if [ "$s" = "" ]; then + echo 0 + return + fi + # Convert hex to decimal. s=$(printf "%d" $((16#$s)))