From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 16 00:55:09 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533E01065672 for ; Tue, 16 Feb 2010 00:55:09 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7D48FC08 for ; Tue, 16 Feb 2010 00:55:08 +0000 (UTC) Received: by pzk40 with SMTP id 40so2680052pzk.7 for ; Mon, 15 Feb 2010 16:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=MVX0tpaFntXZ5G6sjvFfy4lpgPH/iON9ZyPyiklq2Tg=; b=mLo8iTqOkL+bBUGEFf8cTaSGONCrSRWdV3k3mTq+OMAwhBHul8t2yvhDD0g4jHwPtR B9WyJXHko2m4fDgmn8DJJNQkDYsZ7FPaRpCnr8FlwqeFj3peaX0eDiqc43+0p4JH0JtR N0x4txEN6Vokbghc0yI5e5EYv7rzul0V6GpPE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=u6GrSRhY0PxPwzuqStsROOt5vWfFTxUjJU+Cp7d+fpaA5/D8v7Q7bO2osHDQXArif0 c5jJjoMR2/jFBqXfYnsj0tpFlBYXvFLeZcd/tkqWCzlg1xzmLXcs+c9oFYQFGFo2c2Rs Q7Yo9BY49EtLE2Yhmmwdt6oniPaGFxomeFhog= MIME-Version: 1.0 Received: by 10.142.59.21 with SMTP id h21mr3900246wfa.182.1266281708151; Mon, 15 Feb 2010 16:55:08 -0800 (PST) In-Reply-To: <364299f41002151649y2e4d4120p918759afb1fd8f6c@mail.gmail.com> References: <364299f41002151649y2e4d4120p918759afb1fd8f6c@mail.gmail.com> Date: Mon, 15 Feb 2010 16:55:08 -0800 Message-ID: <7d6fde3d1002151655q184c8a21k8a0c6c07b9b0ae79@mail.gmail.com> From: Garrett Cooper To: FreeBSD-Hackers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: read(1) garbage when input redirected from make incorrectly X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 00:55:09 -0000 Hi Hackers, =A0 =A0I accidentally reproduced the following after executing read properly in a pipeline with make: [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ read DESTDIR SRCCONF < /usr/bin/make -V DESTDIR -V SRCCONF bash: read: `-V': not a valid identifier [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ echo $DESTDIR =A0ELF [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ hexdump -C foo 00000000 7f 45 4c 46 01 01 01 0a |.ELF....| 00000008 [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ =A0 =A0Is this an issue to be concerned about apart from cosmetic noise, i.e. potential buffer access problem? I see the same garbage from bash/coreutils on RHEL 4.6 as well as read(1) and /bin/sh on FreeBSD with RELENG_8, so the issue appears to be consistent on multiple OSes... Thanks, -Garrett