Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Oct 2004 02:14:07 +0000
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        Brian Reichert <reichert@numachi.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: awk leaking memory during arithmetic?
Message-ID:  <84dead72041004191479cb774a@mail.gmail.com>
In-Reply-To: <20041004171422.GK262@numachi.com>
References:  <20041004171422.GK262@numachi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I note that 5.2.1 and 4.10 are using different versions of awk.
> 
> Are these awk bugs, or am I misusing awk?  The memory consumption
> under 5.2.1 is what concerns me the most.  I'll open a PR, if that's

It does look like an awk bug:

$ 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*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead72041004191479cb774a>