From nobody@FreeBSD.org  Thu Jan  9 10:15:22 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 7D4D2859
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jan 2014 10:15:22 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 69A89131B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Jan 2014 10:15:22 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s09AFMJ1006441
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 9 Jan 2014 10:15:22 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s09AFMGG006434;
	Thu, 9 Jan 2014 10:15:22 GMT
	(envelope-from nobody)
Message-Id: <201401091015.s09AFMGG006434@oldred.freebsd.org>
Date: Thu, 9 Jan 2014 10:15:22 GMT
From: Alexander Yerenkow <yerenkow@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: csh eats memory
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185603
>Category:       gnu
>Synopsis:       csh(1) eats memory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 09 10:20:01 UTC 2014
>Closed-Date:    
>Last-Modified:  Sun Apr 20 03:23:32 UTC 2014
>Originator:     Alexander Yerenkow
>Release:        9.2-STABLE
>Organization:
>Environment:
FreeBSD r259673 9.2-STABLE FreeBSD 9.2-STABLE #0 r259676: Sat Dec 21 12:16:42 EET 2013     root@testf9s:/usr/obj/zbuilder/src/src-stable-9-clone/sys/GENERIC  amd64

>Description:
csh launching eats more and more memory each time.


#first times - mem is low, but when I launch 4-5 csh-es in tmux, each time i relogin (with csh default shell) I see this:

PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
99711 root          1  52    0   105M 70600K pause   2   0:01  4.98% csh
99717 root          1  52    0   173M   127M pause   3   0:02  7.96% csh
99724 root          1  52    0   305M   228M pause   2   0:03  7.96% csh

After this, I killed all cshes, changed default shell to /bin/sh:


# ps  ax | grep csh | grep -v grep
# 

Again launch csh:
99782 root          1  52    0   313M   235M pause   1   0:03 17.97% csh

I have plenny of ram - about 1.5Gb of free ram in normal state, and I don't have swap at all.


>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Alexander Yerenkow <yerenkow@gmail.com>
To: freebsd-bug-followup <bug-followup@FreeBSD.org>, Alexander Yerenkow <yerenkow@gmail.com>
Cc:  
Subject: Re: gnu/185603: csh eats memory
Date: Thu, 9 Jan 2014 12:46:48 +0200

 --047d7b673c5e90288004ef875300
 Content-Type: text/plain; charset=ISO-8859-1
 
 Seems corrupted history was culprit
 
 https://access.redhat.com/site/solutions/41146
 
 I'd suggest to not parse whole history if it's corrupted, and warn user
 (maybe).
 
 -- 
 Regards,
 Alexander Yerenkow
 
 --047d7b673c5e90288004ef875300--
>Unformatted:
