I am also having this problem. I'm trying to profile libcurl in Ubuntu 16.04 LTS and I get this:
export LD_PROFILE_OUTPUT=`pwd` export LD_PROFILE=libcurl.so.4 src/.libs/lt-curl google.com > /dev/null sprof lib/.libs/libcurl.so.4 libcurl.so.4.profile -p >log _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed! I compiled with -fno-omit-frame-pointer -g -pg in CFLAGS and CXXFLAGS -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to eglibc in Ubuntu. https://bugs.launchpad.net/bugs/462760 Title: sprof fails to work with shared objects Status in eglibc package in Ubuntu: Confirmed Status in eglibc package in Debian: New Status in eglibc package in Fedora: Unknown 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_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!" 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 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/462760/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp