Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jun 2003 22:22:07 +1000
From:      Tim Robbins <tjr@freebsd.org>
To:        current@freebsd.org
Subject:   Re: Apparent i386 alloca.S bug (was: adsl/pppoe no longer connecting on 5.1)
Message-ID:  <20030612222207.A68920@dilbert.robbins.dropbear.id.au>
In-Reply-To: <20030612182944.A62729@dilbert.robbins.dropbear.id.au>; from tjr@freebsd.org on Thu, Jun 12, 2003 at 06:29:44PM %2B1000
References:  <20030612182944.A62729@dilbert.robbins.dropbear.id.au>

index | next in thread | previous in thread | raw e-mail

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


home | help

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