From nobody@FreeBSD.org  Mon Nov 26 19:31:52 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03D4916A419
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Nov 2007 19:31:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D09B513C458
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Nov 2007 19:31:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lAQJVlVH085590
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Nov 2007 19:31:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lAQJVlZP085589;
	Mon, 26 Nov 2007 19:31:47 GMT
	(envelope-from nobody)
Message-Id: <200711261931.lAQJVlZP085589@www.freebsd.org>
Date: Mon, 26 Nov 2007 19:31:47 GMT
From: Paul <pprocacci@datapipe.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tail core dump
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         118267
>Category:       bin
>Synopsis:       tail core dump
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    avatar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 26 19:40:01 UTC 2007
>Closed-Date:    Thu Nov 29 04:42:44 UTC 2007
>Last-Modified:  Thu Nov 29 04:42:44 UTC 2007
>Originator:     Paul
>Release:        7.0-Beta3
>Organization:
>Environment:
FreeBSD  7.0-BETA3 FreeBSD 7.0-BETA3 #0: Sat Nov 24 22:19:04 CST 2007     root@:/usr/obj/usr/src/sys/CUSTOM  i386

>Description:
`tail`ing a directory causes a core dump.

# tail -F /tmp

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: delphij 
State-Changed-When: Mon Nov 26 20:16:01 UTC 2007 
State-Changed-Why:  
Seems to be a double free. 


Responsible-Changed-From-To: freebsd-bugs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Nov 26 20:16:01 UTC 2007 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118267 

From: Maxim Konovalov <maxim@macomnet.ru>
To: Paul <pprocacci@datapipe.com>
Cc: bug-followup@freebsd.org, avatar@freebsd.org
Subject: Re: bin/118267: tail core dump
Date: Mon, 26 Nov 2007 23:14:12 +0300 (MSK)

 > >Description:
 > `tail`ing a directory causes a core dump.
 >
 > # tail -F /tmp
 >
 avatar@ has fixed this issue in HEAD.
 
 -- 
 Maxim Konovalov

From: Xin LI <delphij@delphij.net>
To: Paul <pprocacci@datapipe.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/118267: tail core dump
Date: Mon, 26 Nov 2007 12:15:33 -0800

 This is a multi-part message in MIME format.
 --------------080503080009050405090606
 Content-Type: text/plain; charset=GB2312
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 This seems to be a double free.  Will the attached patch resolve your
 problem?
 
 Cheers,
 - --
 Xin LI <delphij@delphij.net>	http://www.delphij.net/
 FreeBSD - The Power to Serve!
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.4 (FreeBSD)
 
 iD8DBQFHSyllhcUczkLqiksRApzYAJsG3fYojLrI/4noEflStj8vCkb4jQCfR1nb
 Nl5LOGa+dnBI1KtrU8fp9vU=
 =41j2
 -----END PGP SIGNATURE-----
 
 --------------080503080009050405090606
 Content-Type: text/x-csrc;
  name="patch-read.c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-read.c"
 
 Index: read.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/tail/read.c,v
 retrieving revision 1.11.10.1
 diff -u -p -r1.11.10.1 read.c
 --- read.c	24 Oct 2007 12:56:49 -0000	1.11.10.1
 +++ read.c	26 Nov 2007 20:14:18 -0000
 @@ -185,6 +185,7 @@ lines(FILE *fp, off_t off)
  	if (cnt) {
  		llines[recno].l = sp;
  		llines[recno].len = cnt;
 +		sp = NULL;
  		if (++recno == off) {
  			wrap = 1;
  			recno = 0;
 
 --------------080503080009050405090606--
State-Changed-From-To: analyzed->patched 
State-Changed-By: delphij 
State-Changed-When: Mon Nov 26 21:18:44 UTC 2007 
State-Changed-Why:  
Over to avatar@ who committed a patch against -HEAD as MFC reminder. 


Responsible-Changed-From-To: delphij->avatar 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Nov 26 21:18:44 UTC 2007 
Responsible-Changed-Why:  
Over to avatar@ who committed a patch against -HEAD as MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118267 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/118267: commit references a PR
Date: Thu, 29 Nov 2007 03:51:01 +0000 (UTC)

 avatar      2007-11-29 03:50:55 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     usr.bin/tail         read.c 
   Log:
   MFC(1.14): Fixing a double free bug which will cause tail to dump core when
   there's no tailing newline(\n) character.
   
   PR:             bin/118267
   Reviewed by:    kib
   Approved by:    re (kensmith)
   
   Revision   Changes    Path
   1.11.10.2  +1 -0      src/usr.bin/tail/read.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/118267: commit references a PR
Date: Thu, 29 Nov 2007 03:53:45 +0000 (UTC)

 avatar      2007-11-29 03:53:40 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     usr.bin/tail         read.c 
   Log:
   MFC(1.14): Fixing a double free bug which will cause tail to dump core when
   there's no tailing newline(\n) character.
   
   PR:             bin/118267
   Reviewed by:    kib
   Approved by:    re (kensmith)
   
   Revision  Changes    Path
   1.11.2.2  +1 -0      src/usr.bin/tail/read.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/118267: commit references a PR
Date: Thu, 29 Nov 2007 03:55:04 +0000 (UTC)

 avatar      2007-11-29 03:54:56 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6_3)
     usr.bin/tail         read.c 
   Log:
   MFC(1.14): Fixing a double free bug which will cause tail to dump core when
   there's no tailing newline(\n) character.
   
   PR:             bin/118267
   Reviewed by:    kib
   Approved by:    re (kensmith)
   
   Revision      Changes    Path
   1.11.2.1.2.1  +1 -0      src/usr.bin/tail/read.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: avatar 
State-Changed-When: Thu Nov 29 04:40:21 UTC 2007 
State-Changed-Why:  
Fix has been MFC'ed to RELENG_7, RELENG_6 and RELENG_6_3. 

Thanks for the reminder! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118267 
>Unformatted:
