From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 04:06:25 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 5737016A417 for ; Fri, 3 Aug 2007 04:06:25 +0000 (UTC) (envelope-from njf@statseeker.com) Received: from wally.statseeker.com (wally.statseeker.com [203.39.101.146]) by mx1.freebsd.org (Postfix) with ESMTP id D422D13C478 for ; Fri, 3 Aug 2007 04:06:24 +0000 (UTC) (envelope-from njf@statseeker.com) Received: from localhost (localhost.statseeker.com [127.0.0.1]) by wally.statseeker.com (8.13.8/8.13.8) with ESMTP id l733s3hV084677 for ; Fri, 3 Aug 2007 13:54:03 +1000 (EST) (envelope-from njf@statseeker.com) X-Virus-Scanned: amavisd-new at statseeker.com Received: from wally.statseeker.com ([127.0.0.1]) by localhost (wally.statseeker.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xW-4TeWL1VfL for ; Fri, 3 Aug 2007 13:53:53 +1000 (EST) Received: from tardis.statseeker.com (tardis.statseeker.com [10.1.1.79]) (authenticated bits=0) by wally.statseeker.com (8.13.8/8.13.8) with ESMTP id l733rK78084657 for ; Fri, 3 Aug 2007 13:53:20 +1000 (EST) (envelope-from njf@statseeker.com) Message-ID: <46B2A6B0.1030609@statseeker.com> Date: Fri, 03 Aug 2007 13:53:20 +1000 From: Nick Frampton Organization: Statseeker User-Agent: Thunderbird 2.0.0.4 (X11/20070724) MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: 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:06:25 -0000 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 **