From owner-freebsd-current@FreeBSD.ORG Wed Oct 24 07:49:14 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 9248B16A478 for ; Wed, 24 Oct 2007 07:49:14 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.bluestop.org (muon.bluestop.org [IPv6:2001:41c8:1:548a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0D713C49D for ; Wed, 24 Oct 2007 07:49:13 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.draftnet (unknown [IPv6:2a01:348:10f:1::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by muon.bluestop.org (Postfix) with ESMTP id 6A43430180; Wed, 24 Oct 2007 08:49:00 +0100 (BST) Message-ID: <471EF8C2.3010901@cran.org.uk> Date: Wed, 24 Oct 2007 08:48:18 +0100 From: Bruce Cran User-Agent: Thunderbird 2.0.0.6 (X11/20070809) MIME-Version: 1.0 To: andrew_terekhov@yahoo.com References: <986299.70442.qm@web54403.mail.yahoo.com> In-Reply-To: <986299.70442.qm@web54403.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: gcc profiling broken? 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: Wed, 24 Oct 2007 07:49:14 -0000 andrew_terekhov@yahoo.com wrote: > A simple program like this: > > #include > > int main(int argc, char* argv[]) > { > printf("Hello, world!\n"); > > printf("argc: %d\n", argc); > > return 0; > } > > when compiled with profiling: > > gcc -pg -g hello.c -o hello > > dumps core: > > Starting program: /home/andrew/dev/kmv/components/tests/prof/cee/hello > Hello, world! > > Program received signal SIGSEGV, Segmentation fault. > main (argc=Error accessing memory address 0x19: Bad address. > ) at hello.c:7 > 7 printf("argc: %d\n", argc); > > > I run i386 7 beta1 from yesterday. > > gcc -v > Using built-in specs. > Target: i386-undermydesk-freebsd > Configured with: FreeBSD/i386 system compiler > Thread model: posix > gcc version 4.2.1 20070719 [FreeBSD] This was previously reported in August - see the thread "gcc 4.2 profiling breaks argv". I don't think there was any resolution to the problem. On my VIA i386 system I don't get a segfault but argc is 80202633 when -pg is used. -- Bruce