bin/72370: awk in -current dumps core

Joseph Koshy jkoshy at FreeBSD.org
Tue Oct 5 19:20:20 PDT 2004


>Number:         72370
>Category:       bin
>Synopsis:       awk in -current dumps core
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 06 02:20:20 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Joseph Koshy
>Release:        5-current
>Organization:
The FreeBSD Project
>Environment:
FreeBSD orthanc-5 6.0-CURRENT FreeBSD 6.0-CURRENT #4: Sat Sep 25 10:52:35 UTC 2004     root at orthanc-5:/home/obj-current/home/fcpi/src/sys/FCPI  i386
>Description:
awk in 5-current dumps core if asked to deference a positional
parameter at a large positive index.  There also seems to be
numeric overflow occuring behind the scenes.  The following
examples show the difference between GNU awk in 4-STABLE and
the awk in 5-current.

$ echo | /4/usr/bin/awk '{ x = 2147483648; print $x }'
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: attempt to access field -2147483648

$ echo | /4/usr/bin/awk '{ x = 2147483647; print $x }'
*blank line*

$ echo | /5/usr/bin/awk '{ x = 2147483648; print $x }'
/5/usr/bin/awk: trying to access field -2147483648
input record number 1, file
source line number 1

$ echo | /5/usr/bin/awk '{ x = 2147483647; print $x }'
*core dump*

>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list