public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org
Subject: [committed][testsuite] Fix handling of missing section in smaller-than.sh
Date: Wed, 7 Apr 2021 06:16:30 +0200	[thread overview]
Message-ID: <20210407041629.GA27564@delia> (raw)

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  <tdevries@suse.de>

	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)))
 

                 reply	other threads:[~2021-04-07  4:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407041629.GA27564@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).