sprof fails to work with shared objects
Bug #462760 reported by
Indy S.
This bug affects 7 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Debian) |
New
|
Unknown
|
|||
eglibc (Fedora) |
Fix Released
|
Medium
|
|||
eglibc (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libc-dev-bin
When I try to profile a compiled shared object, sprof always fails with: "Inconsistency detected by ld.so: dl-open.c: 672: _dl_open: Assertion `_dl_debug_
I have the environment variables LD_PROFILE and LD_PROFILE_OUTPUT set up as you would expect and a file.so.profile file is created along with gmon.out.
Both the main program and .SO are compiled and linked with -pg
Changed in eglibc (Ubuntu): | |
status: | New → Confirmed |
tags: | added: udd-find |
Changed in eglibc (Debian): | |
status: | Unknown → New |
Changed in eglibc (Fedora): | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
Created attachment 314122
Patch to add __RTLD_SPROF to dlopen_doit() mask
Description of problem:
In recent glibc such as the one included in RHEL5, sprof is not able to open shared librairies anymore. That used to work in previous versions of the glibc such as the one we shipped in RHEL4
Version-Release number of selected component (if applicable):
glibc-2.5-24
How reproducible:
100% reproducible
Steps to Reproduce:
1. LD_PROFILE_ OUTPUT= ${PWD} LD_PROFILE= libgtk- x11-2.0. so.0 gnome-calculator
2. sprof libgtk-x11-2.0.so.0
3.
Actual results:
sprof: failed to load shared object `libgtk- x11-2.0. so.0'
Expected results:
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
index % time self children called name
[0] 0.0 0.00 0.00 0 g_param_spec_object [0]
...
Additional info:
The bug was introduced in dlfcn/dlopen.c in dlopen_doit() by adding a mask for the mode and that mode is missing __RTLD_SPROF so that sprof cannot open the shared lib.
The patch attached adds __RTLD_SPROF to the mode mode so that sprof works.