Date: Wed, 6 Oct 2004 02:18:27 GMT From: Joseph Koshy <jkoshy@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/72370: awk in -current dumps core Message-ID: <200410060218.i962IR3Q002417@www.freebsd.org> Resent-Message-ID: <200410060220.i962KKx9058657@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410060218.i962IR3Q002417>