From owner-freebsd-bugs Wed Apr 9 08:10:05 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA24540 for bugs-outgoing; Wed, 9 Apr 1997 08:10:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA24533; Wed, 9 Apr 1997 08:10:02 -0700 (PDT) Resent-Date: Wed, 9 Apr 1997 08:10:02 -0700 (PDT) Resent-Message-Id: <199704091510.IAA24533@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, Received:(from nobody@localhost) by.freefall.freebsd.org.id.IAA24369;Wed; (8.8.5/8.8.5);, 9 Apr 1997 08:06:47.-0700 (PDT) Message-Id: <199704091506.IAA24369@freefall.freebsd.org> Date: Wed, 9 Apr 1997 08:06:47 -0700 (PDT) From: J.Hogeveen@twiddle.com To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: bin/3240: ls(1) gets segmentation fault. /usr/src/bin/ls/ls.c:428. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 3240 >Category: bin >Synopsis: ls(1) gets segmentation fault. /usr/src/bin/ls/ls.c:428. >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 9 08:10:01 PDT 1997 >Last-Modified: >Originator: Jeroen Hogeveen >Organization: Twiddle >Release: 2.2-STABLE >Environment: FreeBSD dot.twiddle.com 2.2-STABLE FreeBSD 2.2-STABLE #0: Thu Apr 3 10:26:03 GMT 1997 vego@dot.twiddle.com:/usr/src/sys/compile/DOT i386 >Description: Here is a quick output from the gdb debugger: dot# gdb ./ls 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 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc... (gdb) run -l /usr/ports Starting program: /usr/obj/usr/src/bin/ls/./ls -l /usr/ports Program received signal SIGSEGV, Segmentation fault. 0x1fba in display (p=0x33100, list=0x33b00) at /usr/src/bin/ls/ls.c:428 428 if ((ulen = strlen(user)) > maxuser) (gdb) where #0 0x1fba in display (p=0x33100, list=0x33b00) at /usr/src/bin/ls/ls.c:428 #1 0x1d32 in traverse (argc=1, argv=0xefbfd914, options=16) at /usr/src/bin/ls/ls.c:338 #2 0x1ba1 in main (argc=3, argv=0xefbfd90c) at /usr/src/bin/ls/ls.c:275 (gdb) quit The program is running. Quit anyway (and kill it)? (y or n) y I think it gets the segmentation fault from doing a strlen(NULL). Haven't checked if user is NULL yet, though, because of slow connection right now. If I can find some more time soon, I'll look into it. (if it isn't fixed already, by then ;-) >How-To-Repeat: No idea. The problem appears only when doing ls with -l on /usr/ports. On my home system (also 2.2-STABLE) this problem does not occur, so it's unique to the /usr/ports directory at dot.twiddle.com. >Fix: First guess: check if (user) >Audit-Trail: >Unformatted: