From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111286 invoked by alias); 7 Sep 2019 19:53:38 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 111274 invoked by uid 89); 7 Sep 2019 19:53:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=online X-Spam-Status: No, score=-19.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Sep 2019 19:53:35 +0000 Received: from librem.wildebeest.org (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EF8B83085EB9; Sat, 7 Sep 2019 21:53:32 +0200 (CEST) Received: by librem.wildebeest.org (Postfix, from userid 1000) id 8FDCDC02BD; Sat, 7 Sep 2019 21:53:32 +0200 (CEST) Date: Sat, 07 Sep 2019 19:53:00 -0000 From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Ulrich Drepper Subject: Re: Buildbot failure in Wildebeest Builder on whole buildset Message-ID: <20190907195332.GC2631@wildebeest.org> References: <20190907145433.2DF88801C99@builder.wildebeest.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <20190907145433.2DF88801C99@builder.wildebeest.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q3/txt/msg00177.txt.bz2 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1131 On Sat, Sep 07, 2019 at 02:54:33, buildbot@builder.wildebeest.org wrote: > The Buildbot has detected a failed build on builder whole buildset > while building elfutils. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/1/builds/398 > > Buildbot URL: https://builder.wildebeest.org/buildbot/ This happens during make distcheck. It is two issues. First the new test files weren't in EXTRA_DIST causing them to be not available after make dist. This is fixed by the fist attached patch. Second when building with the gcc undefined checker (configure --enable-sanitize-undefined) the sanitizer finds one issue that is undefined: libcpu/riscv_disasm.c:457:57: runtime error: left shift of negative value -1 The issue is that the left shift is done on a signed value. Simply changing the context to be unsigned (as is done in the rest of the code) fixes this. This is the second attached patch. Note that the s390x builder was just taken offline for repairs. It should come back online later this weekend. So it might take a bit for the builder to be completely green again. Cheers, Mark --82I3+IH0IqGh5yIs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-tests-Add-new-riscv64-test-files-to-EXTRA_DIST.patch" Content-length: 1412 >From 1ee98b6c28fbe9ab532ef947cfe46e833535303c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 7 Sep 2019 21:35:10 +0200 Subject: [PATCH] tests: Add new riscv64 test files to EXTRA_DIST Signed-off-by: Mark Wielaard --- tests/ChangeLog | 5 +++++ tests/Makefile.am | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 87c23102..b01ff965 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2019-09-07 Mark Wielaard + + * Makefile.am (EXTRA_DIST): Add run-disasm-riscv64.sh, + testfile-riscv64-dis1.o.bz2 and testfile-riscv64-dis1.expect.bz2. + 2019-08-27 Mark Wielaard * run-readelf-test2.sh: Add -x num testcase. diff --git a/tests/Makefile.am b/tests/Makefile.am index d87d9616..ad0855de 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -438,7 +438,9 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ run-readelf-discr.sh \ testfile-rng.debug.bz2 testfile-urng.debug.bz2 \ run-dwelf_elf_e_machine_string.sh \ - run-elfclassify.sh run-elfclassify-self.sh + run-elfclassify.sh run-elfclassify-self.sh \ + run-disasm-riscv64.sh \ + testfile-riscv64-dis1.o.bz2 testfile-riscv64-dis1.expect.bz2 if USE_VALGRIND valgrind_cmd='valgrind -q --leak-check=full --error-exitcode=1' -- 2.20.1 --82I3+IH0IqGh5yIs Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-libcpu-Make-sure-left-shifts-are-done-in-unsigned-co.patch" Content-length: 1467 >From 65a29626e327b0173174cb25f390426e7808d272 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 7 Sep 2019 21:45:26 +0200 Subject: [PATCH] libcpu: Make sure left shifts are done in unsigned context. Use UINT64_C (0) instead of INT64_C (0) to make sure the calculation is done on unsigned values. Otherwise the gcc undefined sanitizer will warn: libcpu/riscv_disasm.c:457:57: runtime error: left shift of negative value -1 Signed-off-by: Mark Wielaard --- libcpu/ChangeLog | 5 +++++ libcpu/riscv_disasm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog index 883896a2..e23097bd 100644 --- a/libcpu/ChangeLog +++ b/libcpu/ChangeLog @@ -1,3 +1,8 @@ +2019-09-07 Mark Wielaard + + * riscv_disasm.c (riscv_disasm): Use UINT64_C to make calculation + unsigned. + 2019-07-05 Omar Sandoval * Makefile.am: Combine libcpu_{i386,x86_64,bpf}.a into libcpu.a. diff --git a/libcpu/riscv_disasm.c b/libcpu/riscv_disasm.c index bc4e02e5..bc0d8f37 100644 --- a/libcpu/riscv_disasm.c +++ b/libcpu/riscv_disasm.c @@ -453,7 +453,7 @@ riscv_disasm (Ebl *ebl, mne = "fsd"; break; case 16: - opaddr = (((INT64_C (0) - ((first >> 12) & 0x1)) << 11) + opaddr = (((UINT64_C (0) - ((first >> 12) & 0x1)) << 11) | ((first << 2) & 0x400) | ((first >> 1) & 0x300) | ((first << 1) & 0x80) -- 2.20.1 --82I3+IH0IqGh5yIs--