Date: Fri, 3 Aug 2007 08:50:36 +0400 From: Yuri Pankov <yuri@darklight.org.ru> To: Nick Frampton <njf@statseeker.com> Cc: freebsd-current@freebsd.org Subject: Re: gcc 4.2 profiling breaks argv Message-ID: <20070803045036.GA1809@darklight.org.ru> In-Reply-To: <46B2A6B0.1030609@statseeker.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Fri, Aug 03, 2007 at 01:53:20PM +1000, Nick Frampton wrote:
> Hi all,
>
> Programs segfault when attempting to access argv from main when compiled
> under gcc 4.2.0 with the -pg profiling option. The following program
> illustrates this problem.
>
> $ cat test.c
> #include <stdio.h>
> int main (int argc, char **argv) {
> fprintf (stderr, "argv=%p\n", argv);
> return 0;
> }
> $ cc -c -o test.o -pg test.c && cc -o test -pg test.o
> $ ./test
> Segmentation fault (core dumped)
>
> $ cc -v
> Using built-in specs.
> Target: i386-undermydesk-freebsd
> Configured with: FreeBSD/i386 system compiler
> Thread model: posix
> gcc version 4.2.0 20070514 [FreeBSD]
>
> $ uname -a
> FreeBSD test03.statseeker.com 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Fri Aug
> 3 11:07:03 EST 2007
> root@test03.statseeker.com:/usr/obj/usr/src/sys/GENERIC i386
>
> This issue was reported on this list on 5th July 2007 by Garrett Cooper but
> argv was not mentioned in that post. I have not seen this problem reported
> elsewhere (e.g. on the gcc mailing list).
>
> -Nick
> **
FWIW, I can't reproduce it on amd64:
> cc -c -o test.o -pg test.c && cc -o test -pg test.o
> ./test
argv=0x7fffffffe8b0
> cc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.0 20070514 [FreeBSD]
Yuri
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
iD8DBQBGsrQLeoAklVFrLdgRAp5PAKCgpO4H3CzwL9nu9HZCW0oLkmgNlgCff6AK
x8upNoVQ0muIRJLSevNcpEw=
=00NC
-----END PGP SIGNATURE-----
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070803045036.GA1809>
