From owner-freebsd-current@FreeBSD.ORG Thu Jun 12 05:29:14 2003 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 10D2537B401 for ; Thu, 12 Jun 2003 05:29:14 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78E5843F93 for ; Thu, 12 Jun 2003 05:29:13 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (203.134.133.234) by smtp01.syd.iprimus.net.au (7.0.015) id 3EDD516E001D2801 for current@freebsd.org; Thu, 12 Jun 2003 22:29:09 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id 90CBAB4CD; Thu, 12 Jun 2003 22:22:07 +1000 (EST) Date: Thu, 12 Jun 2003 22:22:07 +1000 From: Tim Robbins To: current@freebsd.org Message-ID: <20030612222207.A68920@dilbert.robbins.dropbear.id.au> References: <20030612182944.A62729@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030612182944.A62729@dilbert.robbins.dropbear.id.au>; from tjr@freebsd.org on Thu, Jun 12, 2003 at 06:29:44PM +1000 Subject: Re: Apparent i386 alloca.S bug (was: adsl/pppoe no longer connecting on 5.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2003 12:29:14 -0000 On Thu, Jun 12, 2003 at 06:29:44PM +1000, Tim Robbins wrote: > Here's a test program for the i386 alloca() bug. Compile with -std=gnu89 (or > no -std option) and it works fine. Compile with -std=c99 or -std=c89 and it > breaks like this: > > corruption: 05 should be 0xcc at offset 0 > corruption: 00 should be 0xcc at offset 1 > corruption: 00 should be 0xcc at offset 2 > corruption: 00 should be 0xcc at offset 3 > > Interestingly, gcc -std=c89 on FreeBSD 4.8 doesn't trigger the bug. I should mention that you need to compile with -march=pentiumpro to trigger the bug. It's related to the way gcc 3 uses "movl x,y(%esp)" instead of "pushl x" when passing arguments to a function. I suggest backing out the commit that made CSTD=c99 the default, so that we go back to using gcc's builtin alloca() until we figure out how to fix the one in libc. Tim