https://sourceware.org/bugzilla/show_bug.cgi?id=28720
Bug ID: 28720 Summary: UBSan: member access within misaligned address 0x7f6e8d80f142 for type 'struct Elf32_Phdr', which requires 4 byte alignment Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: evvers at ya dot ru CC: elfutils-devel at sourceware dot org Target Milestone: --- Created attachment 13872 --> https://sourceware.org/bugzilla/attachment.cgi?id=13872&action=edit File triggering misaligned access While I was testing https://sourceware.org/pipermail/elfutils-devel/2021q4/004584.html I passed FUZZ_TIME=3600 to the test to run it for an hour and in the process it ran into another misaligned access. Just to make sure it isn't https://sourceware.org/bugzilla/show_bug.cgi?id=28685 I pulled the master branch with the "fuzz" branch included. It can be reproduced with `./src/stack`: ``` autoreconf -i -f ./configure --enable-maintainer-mode --enable-sanitize-undefined make -j$(nproc) V=1 UBSAN_OPTIONS=print_stacktrace=1:print_summary=1 LD_LIBRARY_PATH="./libdw;./libelf" ./src/stack --core ../SIGABRT.PC.7fffe516d84c.STACK.d7ffe76d7.CODE.-6.ADDR.0.INSTR.mov____%eax,%ebp.fuzz gelf_xlate.h:42:1: runtime error: member access within misaligned address 0x7f3827783142 for type 'struct Elf32_Phdr', which requires 4 byte alignment 0x7f3827783142: note: pointer points here 00 00 00 10 00 00 00 00 00 c5 00 10 00 00 00 00 00 00 00 10 00 00 00 00 00 00 01 00 00 00 06 15 ^ #0 0x7f38295f992c in Elf32_cvt_Phdr /home/vagrant/elfutils/libelf/gelf_xlate.h:42 #1 0x7f38295f8363 in elf32_xlatetom /home/vagrant/elfutils/libelf/elf32_xlatetom.c:104 #2 0x7f382952a821 in dwfl_link_map_report /home/vagrant/elfutils/libdwfl/link_map.c:925 #3 0x7f382952de80 in _new.dwfl_core_file_report /home/vagrant/elfutils/libdwfl/core-file.c:548 #4 0x402fa0 in parse_opt /home/vagrant/elfutils/src/stack.c:595 #5 0x7f382878b471 in argp_parse (/lib64/libc.so.6+0x11e471) #6 0x4026aa in main /home/vagrant/elfutils/src/stack.c:695 #7 0x7f382869a55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f) #8 0x7f382869a60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b) #9 0x402944 in _start (/home/vagrant/elfutils/src/stack+0x402944) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior gelf_xlate.h:42:1 in ``` -- You are receiving this mail because: You are on the CC list for the bug.