Can't profile automatically on x86/amd64 (after gcc 3.4.6 -> 4.2 upgrade?)

From: Garrett Cooper <youshi10_at_u.washington.edu>
Date: Wed, 04 Jul 2007 20:30:05 -0700
    I don't know why but it appears that I can't automatically profile 
programs compiled with -pg. I've tried compensating by using 
clock_gettime(2), but I believe my energies can be better focused 
elsewhere instead of entering in a slew of printf(2) statements, by 
using gprof(1).

    When I try and use -pg under x86, the compiled program segfaults and 
when I try and backtrace the binary it segfaults and there appears to be 
an infinite recursion problem, then it dies at a point when it can't 
access the memory address:

Program received signal SIGSEGV, Segmentation fault.
0x080506b4 in ?? ()
(gdb) bt
#0  0x080506b4 in ?? ()
#1  0x33cb8a00 in ?? ()
#2  0x33d3a951 in ?? ()
#3  0xbfbfeb38 in ?? ()
#4  0x33c91530 in ?? ()
#5  0x00000007 in ?? ()
#6  0x33cb71c0 in ?? ()
#7  0xbfbfeacc in ?? ()

// etc ...

#1350 0x90feeb80 in ?? ()
#1351 0xbfbfed28 in ?? ()
#1352 0x00000001 in ?? ()
#1353 0xbfbfed30 in ?? ()
#1354 0x00000013 in ?? ()
Error accessing memory address 0xbfc00000: Bad address.

    When I try and do the same under amd64, gprof(1) says "bad format" 
(an error attributed to bfd(1) not being able to decypher the bin info 
of the .gmon file).

-Garrett
Received on Thu Jul 05 2007 - 01:30:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:13 UTC