From owner-freebsd-current@FreeBSD.ORG Tue Oct 5 02:14:11 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B342116A4CE for ; Tue, 5 Oct 2004 02:14:11 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D70A43D48 for ; Tue, 5 Oct 2004 02:14:11 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by mproxy.gmail.com with SMTP id 74so262868rnk for ; Mon, 04 Oct 2004 19:14:07 -0700 (PDT) Received: by 10.38.208.53 with SMTP id f53mr5937879rng; Mon, 04 Oct 2004 19:14:07 -0700 (PDT) Received: by 10.38.13.17 with HTTP; Mon, 4 Oct 2004 19:14:07 -0700 (PDT) Message-ID: <84dead72041004191479cb774a@mail.gmail.com> Date: Tue, 5 Oct 2004 02:14:07 +0000 From: Joseph Koshy To: Brian Reichert In-Reply-To: <20041004171422.GK262@numachi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20041004171422.GK262@numachi.com> cc: freebsd-current@freebsd.org Subject: Re: awk leaking memory during arithmetic? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joseph Koshy List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 02:14:11 -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*