On Tue, 2018-11-13 at 16:42 +0000, 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/3/builds/299
This is disappointing. You fix one bug and find another :) The issue here is (when running the testsuite under gcc undefinedness sanitizer): runtest testfile-debug-rel-ppc64-z.o ../../../libelf/gelf_xlate.h:53:1: runtime error: member access within misaligned address 0x00000402928d for type 'struct Elf64_Chdr', which requires 8 byte alignment 0x00000402928d: note: pointer points here 1d bb 0a c3 01 00 00 00 00 00 00 00 71 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 78 9c 63 60 ^ *** failure strip testfile-debug-rel-ppc64-z.o ../../../libelf/gelf_xlate.h:53:1: runtime error: member access within misaligned address 0x000004029175 for type 'struct Elf64_Chdr', which requires 8 byte alignment 0x000004029175: note: pointer points here 1d bb 0a c3 01 00 00 00 00 00 00 00 71 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 78 9c 63 60 ^ *** failure strip --reloc-debug-sections testfile-debug-rel-ppc64-z.o This happens when writing out the file to disk. The section is compressed, and we try to write it back to disk, for this we need to translate the on disk Elf_Chdr (because it is a big endian ELF file and the memory representation on x86_64 is little endian): #1 0x00007ffff7f8ad98 in Elf64_cvt_Chdr (encode=<optimized out>, len=<optimized out>, src=<optimized out>, dest=<optimized out>) at gelf_xlate.h:37 #2 Elf64_cvt_chdr (dest=<optimized out>, src=0x439380, len=69, encode=<optimized out>) at chdr_xlate.h:32 #3 0x00007ffff7f9fd96 in __elf64_updatemmap (elf=elf@entry=0x4377c0, change_bo=change_bo@entry=1, shnum=shnum@entry=22) at elf32_updatefile.c:368 #4 0x00007ffff7f98a3d in write_file (shnum=22, change_bo=1, size=2872, elf=0x4377c0) at elf_update.c:121 #5 elf_update (elf=0x4377c0, cmd=cmd@entry=ELF_C_WRITE) at elf_update.c:231 #6 0x000000000040bd29 in handle_elf (fd=3, elf=<optimized out>, mode=436, tvp=0x0, prefix=0x0) at strip.c:2448 #7 0x000000000040f4be in process_file ( fname=0x7fffffffdbab "testfile-debug-rel-ppc64-z.o") at strip.c:769 #8 0x0000000000402bdf in main (argc=5, argv=0x7fffffffd848) at strip.c:265 The compressed sections however simply have an alignment of 1. I think this is really a bug in binutils gas which produced this particular testfile. But it looks like we make the same mistake (decompressing and recompressing with eu-elfcompress produces the same misaligned compressed section). So we might actually have two bugs. 1) we don't handle incorrectly aligned compressed sections and 2) we generate such incorrectly aligned compressed sections ourselves. Pondering fixes. Cheers, Mark