NetBSD Problem Report #11904

Received: (qmail 4069 invoked from network); 6 Jan 2001 18:55:09 -0000
Message-Id: <20010106185426Z2996-16001+8@cesium.clock.org>
Date: Sat, 6 Jan 2001 10:54:23 -0800
From: fair@clock.org
Sender: fair@clock.org
Reply-To: fair@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: tail segfaults and core dumps on I/O error
X-Send-Pr-Version: 3.95

>Number:         11904
>Category:       bin
>Synopsis:       tail segfaults and core dumps on I/O error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 06 18:56:00 +0000 2001
>Closed-Date:    
>Last-Modified:  Tue Sep 30 04:55:01 +0000 2008
>Originator:     Erik E. Fair
>Release:        1.3.2
>Organization:
	International Organization of Internet Clock Watchers
>Environment:

System: NetBSD cesium.clock.org 1.3.2 NetBSD 1.3.2 (CESIUM) #0: Sat Sep 12 19:30:08 PDT 1998 root@:/usr/src/sys/arch/sparc/compile/CESIUM sparc

SPARC LX (50 MHz microSPARC I CPU), 96MB RAM, 8GB disk
/var/run/dmesg.boot available upon request.

>Description:
	tail core dumps when the file is it reading gives an I/O
	error due to a bad block.  I have a shell script that I
	use to watch my web logs in a screen window:

	#!/bin/sh
	exec tail $* /var/log/httpd.access_log | egrep $USER

	My disks are getting old, and the other day, a bad block
	showed up in /var in the httpd.access_log. When the script
	above was invoked, tail core dumped when it read the bad
	block.

	This is not acceptable behavior on the part of any program
	that reads files; it should gracefully error out.

	Aside from fixing this particular program, it might be a
	good idea to create a filesystem or other test-rig that
	can deliver an I/O error to any arbitrary program, since
	tail is unlikely to be the only program with this class of
	problem - the rest of the userland should be tested, too,
	so that UNIX is more robust in the face of system failure.

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:

From: John Hawkinson <jhawk@MIT.EDU>
To: fair@clock.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/11904: tail segfaults and core dumps on I/O error
Date: Sat, 6 Jan 2001 13:58:07 -0500 (EST)

 | >Description:
 | 	  tail core dumps when the file is it reading gives an I/O
 | 	  error due to a bad block.  I have a shell script that I
 | 	  use to watch my web logs in a screen window:

 When submitting a PR about a core dump, please include the stack
 trace. Especially against a dated version like 1.3.2.

 Thanks.

 --jhawk
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/11904: tail segfaults and core dumps on I/O error
Date: Tue, 30 Sep 2008 04:52:30 +0000

 The problem appears to be that tail does most of its I/O with mmap.
 So one can't avoid getting SIGSEGV. We could, however, catch SIGSEGV,
 inspect the fault address, and print "Read error" if it's inside the
 input file.

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.