From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 04:50:57 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B2D16A421 for ; Fri, 3 Aug 2007 04:50:57 +0000 (UTC) (envelope-from yuri@darklight.org.ru) Received: from darklight.org.ru (crsd-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2d5::2]) by mx1.freebsd.org (Postfix) with ESMTP id D28C213C45D for ; Fri, 3 Aug 2007 04:50:55 +0000 (UTC) (envelope-from yuri@darklight.org.ru) Received: from darklight.org.ru (yuri@darklight.org.ru [127.0.0.1]) by darklight.org.ru (8.14.1/8.14.1) with ESMTP id l734ocE4001825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Aug 2007 08:50:43 +0400 (MSD) (envelope-from yuri@darklight.org.ru) Received: (from yuri@localhost) by darklight.org.ru (8.14.1/8.14.1/Submit) id l734oaVO001824; Fri, 3 Aug 2007 08:50:36 +0400 (MSD) (envelope-from yuri@darklight.org.ru) Date: Fri, 3 Aug 2007 08:50:36 +0400 From: Yuri Pankov To: Nick Frampton Message-ID: <20070803045036.GA1809@darklight.org.ru> References: <46B2A6B0.1030609@statseeker.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <46B2A6B0.1030609@statseeker.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Greylist: Sender is SPF-compliant, not delayed by milter-greylist-3.0 (darklight.org.ru [127.0.0.1]); Fri, 03 Aug 2007 08:50:43 +0400 (MSD) Cc: freebsd-current@freebsd.org Subject: Re: gcc 4.2 profiling breaks argv X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 03 Aug 2007 04:50:57 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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= =20 > under gcc 4.2.0 with the -pg profiling option. The following program=20 > illustrates this problem. > > $ cat test.c > #include > int main (int argc, char **argv) { > fprintf (stderr, "argv=3D%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= =20 > 3 11:07:03 EST 2007 =20 > 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 b= ut=20 > argv was not mentioned in that post. I have not seen this problem report= ed=20 > 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=3D0x7fffffffe8b0 > 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 --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGsrQLeoAklVFrLdgRAp5PAKCgpO4H3CzwL9nu9HZCW0oLkmgNlgCff6AK x8upNoVQ0muIRJLSevNcpEw= =00NC -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--