Subject: bin/6451: diff seg faults when fed one or more nonexistent files
To: None <>
From: None <>
List: netbsd-bugs
Date: 11/17/1998 08:43:43
>Number:         6451
>Category:       bin
>Synopsis:       diff seg faults when fed one or more nonexistent files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 17 06:50:01 1998
>Originator:     Frederick Bruckman

>Release:        November 16, 1998
System: NetBSD 1.3H NetBSD 1.3H (FB) #142: 
Mon Nov 16 11:23:30 CST 1998
/usr/src/sys/arch/mac68k/compile/FB mac68k

	Just like it says. Using stock compiler, "make build" done against 
	November 16 sup with default options.

	Could be related to bin/5824: ldd quits with signal 11 if lib is not


Here's a backtrace from a "diff" built with CFLAGS=-g.

root-> ./diff nonexistent none   
./diff: Segmentation fault (core dumped)
root-> gdb ./diff diff.core
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (m68k--netbsd), Copyright 1996 Free Software Foundation, Inc...
Core was generated by `diff'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/libexec/
Reading symbols from /usr/lib/
Reading symbols from /usr/lib/
#0  0x407a736 in strlen ()
(gdb) bt
#0  0x407a736 in strlen ()
#1  0x4065e58 in perror ()
#2  0x9e4a in perror_with_name (text=0xffffc7db "nonexistent") at util.c:57
#3  0x510a in compare_files (dir0=0x0, name0=0xffffc7db "nonexistent", 
    dir1=0x0, name1=0xffffc7e7 "none", depth=0) at diff.c:919
#4  0x3b7e in main (argc=3, argv=0xffffc750) at diff.c:631
(gdb) quit