From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 05:02:42 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 E7C3E16A418 for ; Fri, 3 Aug 2007 05:02:42 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout5.cac.washington.edu (mxout5.cac.washington.edu [140.142.32.135]) by mx1.freebsd.org (Postfix) with ESMTP id C1E1513C459 for ; Fri, 3 Aug 2007 05:02:42 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout5.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.06) with ESMTP id l7352SHN002007 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Aug 2007 22:02:28 -0700 X-Auth-Received: from [192.168.10.45] (c-24-10-12-194.hsd1.ca.comcast.net [24.10.12.194]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l7352Fjw010187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 2 Aug 2007 22:02:27 -0700 Message-ID: <46B2B6D3.3080509@u.washington.edu> Date: Thu, 02 Aug 2007 22:02:11 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Yuri Pankov References: <46B2A6B0.1030609@statseeker.com> <20070803045036.GA1809@darklight.org.ru> In-Reply-To: <20070803045036.GA1809@darklight.org.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.3.310218, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.8.2.214923 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: freebsd-current@freebsd.org, Nick Frampton 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 05:02:43 -0000 Yuri Pankov wrote: > 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 >> 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 > I've already posted 2 other threads, and I believe a bug report about this. -Garrett