Bug 46906 - program compiled with profiling (gcc -profile) crashes instantly
Summary: program compiled with profiling (gcc -profile) crashes instantly
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-07-01 23:53 UTC by David Mansfield
Modified: 2016-11-24 15:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-07-01 23:53:48 UTC
Embargoed:


Attachments (Terms of Use)

Description David Mansfield 2001-07-01 23:53:45 UTC
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 
startup.

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:
Always.

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

Actual Results:
segfault

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 13:30:46 UTC
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.