From owner-freebsd-current@FreeBSD.ORG Wed Oct 24 12:30:11 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 0365B16A420 for ; Wed, 24 Oct 2007 12:30:11 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id C0BF013C4B5 for ; Wed, 24 Oct 2007 12:30:10 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 7BAB320F8E; Wed, 24 Oct 2007 15:29:59 +0300 (EEST) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25537-07; Wed, 24 Oct 2007 15:29:58 +0300 (EEST) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id D1C4620F88; Wed, 24 Oct 2007 15:29:58 +0300 (EEST) Message-ID: <471F3AC5.5020803@bulinfo.net> Date: Wed, 24 Oct 2007 15:29:57 +0300 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.6 (X11/20070927) MIME-Version: 1.0 To: Bruce Cran References: <986299.70442.qm@web54403.mail.yahoo.com> <471EF8C2.3010901@cran.org.uk> In-Reply-To: <471EF8C2.3010901@cran.org.uk> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: freebsd-current@freebsd.org, andrew_terekhov@yahoo.com 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 12:30:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Cran wrote: > 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. May be this is platform dependent? # gcc -pg -g hello.c -o hello # ./hello Hello, world! argc: 1 # uname -srp FreeBSD 7.0-CURRENT arm # cc -v Using built-in specs. Target: arm-undermydesk-freebsd Configured with: FreeBSD/arm system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD] > > -- > Bruce > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHHzrFxJBWvpalMpkRAvWQAJwMLZNcZJIP61LF/j9NfkBNJNw8TgCfbHOy ans6RdbjHGlWbQKhNq2i8ws= =kXq3 -----END PGP SIGNATURE-----