This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug glob/20707] gl_pathv entries not set to NULL with GLOB_DOOFFS
- From: "mike at php dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 18 Oct 2016 06:14:37 +0000
- Subject: [Bug glob/20707] gl_pathv entries not set to NULL with GLOB_DOOFFS
- Auto-submitted: auto-generated
- References: <bug-20707-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20707
--- Comment #2 from Michael Wallner <mike at php dot net> ---
Hmmm, did you try and run the test program? Without the sanitizer, it's not
always observable, because the allocated memory may only contain NULs.
Here's what I get, reproducibly:
$ make -B && ./main
cc -fsanitize=address -Wall -c -o main.o main.c
cc -lasan main.o -o main
ASAN:DEADLYSIGNAL
=================================================================
==6998==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc
0x7fe795439376 bp 0x7fffbc2d0a10 sp 0x7fffbc2d0168 T0)
#0 0x7fe795439375 in strlen (/usr/lib/libc.so.6+0x80375)
#1 0x7fe7957ad65b in unpoison_glob_t
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1658
#2 0x7fe7957ae0df in __interceptor_glob
/build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1719
#3 0x400ad5 in main (/home/mike/tmp/glob-test/main+0x400ad5)
#4 0x7fe7953d9290 in __libc_start_main ../csu/libc-start.c:289
#5 0x400909 in _start (/home/mike/tmp/glob-test/main+0x400909)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/libc.so.6+0x80375) in strlen
==6998==ABORTING
$ cat Makefile
CFLAGS ?= -fsanitize=address -Wall
LDFLAGS ?= -lasan
main: main.o
$ gcc --version
gcc (GCC) 6.2.1 20160830
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--
You are receiving this mail because:
You are on the CC list for the bug.