On Sat, Sep 07, 2019 at 02:54:33, build...@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
>From 1ee98b6c28fbe9ab532ef947cfe46e833535303c Mon Sep 17 00:00:00 2001
From: Mark Wielaard <m...@klomp.org>
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 <m...@klomp.org>
---
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 <m...@klomp.org>
+
+ * 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 <m...@klomp.org>
* 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
>From 65a29626e327b0173174cb25f390426e7808d272 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <m...@klomp.org>
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 <m...@klomp.org>
---
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 <m...@klomp.org>
+
+ * riscv_disasm.c (riscv_disasm): Use UINT64_C to make calculation
+ unsigned.
+
2019-07-05 Omar Sandoval <osan...@fb.com>
* 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