From fn@LISP-READER.csrv.uidaho.edu  Wed Nov  6 07:47:02 1996
Received: from zork.hungry.com (dialin067.csrv.uidaho.edu [129.101.112.77])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA26697
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 6 Nov 1996 07:47:00 -0800 (PST)
Received: (from fn@localhost) by zork.hungry.com (8.8.2/8.6.9) id HAA07391; Wed, 6 Nov 1996 07:46:13 -0800 (PST)
Message-Id: <199611061546.HAA07391@zork.hungry.com>
Date: Wed, 6 Nov 1996 07:46:13 -0800 (PST)
From: fn@uidaho.edu
Reply-To: fn@uidaho.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: csh limtail() bug
X-Send-Pr-Version: 3.2

>Number:         1970
>Category:       bin
>Synopsis:       csh limtail() bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov  6 07:50:01 PST 1996
>Closed-Date:    Sun Jun 11 11:46:54 PDT 2000
>Last-Modified:  Sun Jun 11 11:47:48 PDT 2000
>Originator:     faried nawaz
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Hungry Programmers, Inc.
>Environment:

i made a brain-o and typed 'limit datasize maxproc 256' instead of
'limit maxproc 256'.

>Description:

limtail() strips off the leading 'm' when its second argument is "megabytes".

>How-To-Repeat:

% limit
cputime         unlimited
filesize        unlimited
datasize        65536 kbytes
stacksize       8192 kbytes
coredumpsize    unlimited
memoryuse       14572 kbytes
memorylocked    4858 kbytes
maxproc         40 
openfiles       64 
% limit datasize maxprox 256
Bad scaling; did you mean "egabytes"?.
% 

% gdb -q ./csh
(gdb) b limtail
Breakpoint 1 at 0x10293: file func.c, line 1276.
(gdb) r
Starting program: /tmp/csh/./csh 
% limit datasize mblah

Breakpoint 1, limtail (cp=0x2d380, str=0xfd5f "megabytes") at func.c:1276
1276        while (*cp && *cp == *str)
(gdb) print *cp
$1 = 109
(gdb) print str
$2 = 0xfd5f "megabytes"
(gdb) list
1271    static void
1272    limtail(cp, str)
1273        Char   *cp;
1274        char   *str;
1275    {
1276        while (*cp && *cp == *str)
1277            cp++, str++;
1278        if (*cp)
1279            stderror(ERR_BADSCALE, str);
1280    }
(gdb) step
1277            cp++, str++;
(gdb) step
1278        if (*cp)
(gdb) print str
$3 = 0xfd60 "egabytes"
(gdb) quit
The program is running.  Quit anyway (and kill it)? (y or n) y
% 


>Fix:
	
i don't know.  use rc instead of csh? :)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Mon May 25 00:53:45 PDT 1998 
State-Changed-Why:  
Awaiting committer 
State-Changed-From-To: suspended->closed 
State-Changed-By: nrahlstr 
State-Changed-When: Sun Jun 11 11:46:54 PDT 2000 
State-Changed-Why:  
This has been fixed by the import of the latest tcsh. 
(tcsh_6_09_01_cvs_20000610) 


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