Subject: pkg/5041: rc in package source drops core when saying "limit" or "limit -h"
To: None <gnats-bugs@gnats.netbsd.org>
From: None <smd@ebone.net>
List: netbsd-bugs
Date: 02/23/1998 17:21:41
>Number:         5041
>Category:       pkg
>Synopsis:       long data type treated as int in fprint in builtins.c for limit command
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 23 08:35:00 1998
>Last-Modified:
>Originator:     Sean Doran
>Organization:
Sean Doran <smd@ebone.net>
Development Manager, Ebone Inc., Copenhagen Denmark
>Release:        NetBSD-current Feb 21 1998 tar balls
>Environment:
System: NetBSD sean.ebone.net 1.3D NetBSD 1.3D (EBONE) #0: Sun Feb 22 21:41:16 CET 1998 smd@sean.ebone.net:/usr/src/sys/arch/i386/compile/EBONE i386


>Description:
	Running the "limit" builtin command causes a core dump
        immediately upon printing the first numerical limit.

        Note that "make trip" in the package work directory fails
        because of this.
>How-To-Repeat:
	run rc in an environment where e.g. datasize is a non-infinite value
	type "limit"
	type return
>Fix:
	workaround: don't type "limit" or "limit -h" without a value
        workaround ii: cast lim arg to int type in builtin.c:printlimit()
		       fprint call in line 495
                       (this generally gives you ok output
			from the limit builtin command and
			causes "make trip" to work)
        fix: clean up disgusting grot in print.c to allow for a %l
	     type, and change the fprint call in builtins.c:printlimit()
             to use %l instead of %d.
        the latest rc stuff may already have a fix?
>Audit-Trail:
>Unformatted: