Re: awk leaking memory during arithmetic?

From: Joseph Koshy <joseph.koshy_at_gmail.com>
Date: Tue, 5 Oct 2004 02:14:07 +0000
> 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*
Received on Tue Oct 05 2004 - 00:14:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:15 UTC