I'm trying to use sprof to profile some software (ossim) where almost all the code is in a shared library. I've generated a profiling file, but when I run sprof, I get the following error:
我尝试使用sprof来配置一些软件(ossim),几乎所有的代码都在共享库中。我生成了一个概要文件,但是当我运行sprof时,我得到以下错误:
> sprof /home/eca7215/usr/lib/libossim.so.1 libossim.so.1.profile -p > log
Inconsistency detected by ld.so: dl-open.c: 612: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
The instructions I was following said that I needed libc version at least 2.5-34, I have libc version 2.12.2 (Gentoo, kernel 2.6.36-r5).
下面的说明说明我需要libc版本至少2.5-34,我有libc version 2.12.2 (Gentoo, kernel 2.6.36-r5)。
I can't find any explanation as to what the error means or (more interestingly) how to fix it, the only half-relevant google results are for a bug in an old version of Skype.
我找不到任何解释说明错误是什么意思,或者(更有趣的是)如何修复它,唯一的半相关谷歌结果是在一个旧版本的Skype上的bug。
1 个解决方案
#1
5
I got a bit curious since this is still broken in OpenSuse 12.x. I would have thought a bug originally reported in '09 or so would have been fixed by now. I guess nobody really uses sprof. (or maybe dl-open is so fragile that people are scared to touch it :-)
我有点好奇,因为这仍然是在OpenSuse 12.x中被打破的。我原以为在09年左右的时候会有一个错误的报告被修正。我想没有人会使用sprof。(或者可能是dl-open是如此脆弱,以至于人们不敢碰它:-)
The issue boils down to the __RTLD_SPROF flag used as argument to dlopen. Take any simple program that calls dlopen, or that flag to the second arg and you get the same failed assertion. I used the sample program at the bottom of http://linux.die.net/man/3/dlopen as an example
这个问题归结为使用的__RTLD_SPROF标记作为dlopen的参数。使用任何调用dlopen的简单程序,或者将该标志标记为第二个arg,您将得到相同的失败断言。我在http://linux.die.net/man/3/dlopen的底部使用了示例程序。
handle = dlopen(argv[1], RTLD_LAZY | __RTLD_SPROF);
From what I can tell from a quick look at dl-open.c, this flags short circuits some of what dl_open does. So the r_flag specified in the assertion doesn't get set to RT_CONSISTENT.
从我一眼就能看出来的。这标志着dl_open所做的一些事情。因此,断言中指定的r_flag不会被设置为rt_一致性。
#1
5
I got a bit curious since this is still broken in OpenSuse 12.x. I would have thought a bug originally reported in '09 or so would have been fixed by now. I guess nobody really uses sprof. (or maybe dl-open is so fragile that people are scared to touch it :-)
我有点好奇,因为这仍然是在OpenSuse 12.x中被打破的。我原以为在09年左右的时候会有一个错误的报告被修正。我想没有人会使用sprof。(或者可能是dl-open是如此脆弱,以至于人们不敢碰它:-)
The issue boils down to the __RTLD_SPROF flag used as argument to dlopen. Take any simple program that calls dlopen, or that flag to the second arg and you get the same failed assertion. I used the sample program at the bottom of http://linux.die.net/man/3/dlopen as an example
这个问题归结为使用的__RTLD_SPROF标记作为dlopen的参数。使用任何调用dlopen的简单程序,或者将该标志标记为第二个arg,您将得到相同的失败断言。我在http://linux.die.net/man/3/dlopen的底部使用了示例程序。
handle = dlopen(argv[1], RTLD_LAZY | __RTLD_SPROF);
From what I can tell from a quick look at dl-open.c, this flags short circuits some of what dl_open does. So the r_flag specified in the assertion doesn't get set to RT_CONSISTENT.
从我一眼就能看出来的。这标志着dl_open所做的一些事情。因此,断言中指定的r_flag不会被设置为rt_一致性。