https://sourceware.org/bugzilla/show_bug.cgi?id=21433
Bug ID: 21433 Summary: Runtime error in ar Product: binutils Version: 2.28 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: dungnguy at comp dot nus.edu.sg Target Milestone: --- Dear All, This bug was found with AFLGo, a directed version of AFL/AFLFast. Thanks also to Marcel Böhme and Van-Thuan Pham. This bug was found on Ubuntu 14.04 64-bit & binutils was checked out from main repository at git://sourceware.org/git/binutils-gdb.git. Its commit is a49abe0bb18e04d3a4b692995fcfae70cd470775 (Tue Apr 25 00:00:36 2017). binutils was built with ASAN using gcc-6.2 and clang-3.4. The configure command was: CC=clang CFLAGS="-DFORTIFY_SOURCE=2 -fstack-protector-all -fsanitize=undefined,address -fno-omit-frame-pointer -g -Wno-error" ../configure --disable-shared --disable-gdb --disable-libdecnumber --disable-readline --disable-sim To reproduce: ar -s ASAN says: ../../binutils/bucomm.c:590:13: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/x86_64-linux-gnu/sys/stat.h:210:43: note: nonnull attribute specified here SUMMARY: AddressSanitizer: undefined-behavior ../../binutils/bucomm.c:590:13 in /home/ubuntu/binutils-analysis/binutils-gdb/obj-asan/binutils/ar: Warning: could not locate '(null)'. reason: Bad address VALGRIND says: ==171860== Syscall param stat(file_name) points to unaddressable byte(s) ==171860== at 0x51298B5: _xstat (xstat.c:35) ==171860== by 0x40845B: stat (stat.h:455) ==171860== by 0x40845B: get_file_size (bucomm.c:590) ==171860== by 0x406538: ranlib_only (ar.c:1433) ==171860== by 0x4038E6: main (ar.c:761) ==171860== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==171860== -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils