Sat 27 Mar 2010 11:39:02 AM UTC, original submission:
On fencepost.gnu.org there is a segmentation fault showing up in grep-2.6.1 in recursive grep with --include with empty subdirectories. The complete build log for grep is at /gd/gnu/gnusys/logs/grep-2.6.1.log
Test case:
bjg@fencepost:~/ftp/foo$ mkdir emptydir
bjg@fencepost:~/ftp/foo$ mkdir emptydir/1
bjg@fencepost:~/ftp/foo$ mkdir emptydir/2
bjg@fencepost:~/ftp/foo$ grep -r --include='*.am' -i ICONV emptydir
Segmentation fault
bjg@fencepost:~/ftp/foo$ gdb grep
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) run -r --include='*.am' -i ICONV emptydir
Starting program: /srv/data/home/g/gnu/gnusys/live/bin/grep -r --include='*.am' -i ICONV emptydir
Program received signal SIGSEGV, Segmentation fault.
0x000000000040f180 in isdir1 (dir=0x7fff36bd26ca "emptydir", file=0x1e18afb "1") at savedir.c:51
51 savedir.c: No such file or directory.
in savedir.c
(gdb) bt
#0 0x000000000040f180 in isdir1 (dir=0x7fff36bd26ca "emptydir", file=0x1e18afb "1") at savedir.c:51
#1 0x000000000040f2f5 in savedir (dir=<value optimized out>, name_size=22, included_patterns=<value optimized out>,
excluded_patterns=0x0, excluded_directory_patterns=<value optimized out>) at savedir.c:112
#2 0x00000000004068e9 in grepdir (dir=0x7fff36bd26ca "emptydir", stats=0x6281e0) at main.c:1339
#3 0x0000000000405136 in grepfile (file=0x7fff36bd26ca "emptydir", stats=0x6281e0) at main.c:1083
#4 0x0000000000405adc in main (argc=6, argv=0x7fff36bd0888) at main.c:2193
(gdb)
bjg@fencepost:~/ftp/foo$ grep --version
GNU grep 2.6.1
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
|