Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 46906 - program compiled with profiling (gcc -profile) crashes instantly
program compiled with profiling (gcc -profile) crashes instantly
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-07-01 19:53 EDT by David Mansfield
Modified: 2016-11-24 10:24 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-01 19:53:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Mansfield 2001-07-01 19:53:45 EDT
Description of Problem:

I'm trying to use profiling with an application I'm writing.  When I just 
compile with -pg (flag to gcc) it works.  When I switch to -profile (flag 
to gcc), or explicitly link in the libc_p, libm_p, libdl_p etc. in order 
to get profiling data on c-library calls, it segfaults immediately upon 

Here's the gdb trace:
#0  0x0806fb0f in _dl_lookup_versioned_symbol (undef_name=0x40016d64 
"\bm\001@", ref=0x4070b1f0, symbol_scope=0x7, reference_name=0x0, 
    version=0x1, reloc_type=1073836912) at dl-lookup.c:193
#1  0x4000c28c in ?? ()
#2  0x400028cf in ?? ()
#3  0x4001048f in ?? ()
#4  0x40002382 in ?? ()
#5  0x400020ae in ?? ()

The program is also linking to the Oracle 8.1.7 OCI libraries.  

The same thing happens regardless of whether I use the 'oracle 
workaround' specified in the 7.1 release notes.

I also tried bringing the libc_p etc libraries from a 6.2 system. (there 
is no compat-glibc-profile package).  Same.

I also tried building the entire application on a straight-up redhat 6.2 
system, with the oracle headers and libraries present on that system.  It 
crashes in exactly the same way.

How Reproducible:

Steps to Reproduce:
1. build with -profile
2. run

Actual Results:

Expected Results:
run as without -profile

Additional Information:
I can get perfect profiling info about my own code (i.e. just the -pg) 
but I need libc profiling.
Comment 1 Jakub Jelinek 2001-08-09 09:30:46 EDT
No wonder when you link to one static libc_p.a and shared libc.so.6 at the
same time (plus dynamic linker).
Use -profile -static -pg.

Note You need to log in before you can comment on or make changes to this bug.