Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2007 08:48:18 +0100
From:      Bruce Cran <bruce@cran.org.uk>
To:        andrew_terekhov@yahoo.com
Cc:        freebsd-current@freebsd.org
Subject:   Re: gcc profiling broken?
Message-ID:  <471EF8C2.3010901@cran.org.uk>
In-Reply-To: <986299.70442.qm@web54403.mail.yahoo.com>
References:  <986299.70442.qm@web54403.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
andrew_terekhov@yahoo.com wrote:
> A simple program like this:
> 
> #include <stdio.h>
> 
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?471EF8C2.3010901>