【问题标题】:Example in the sprof MAN page is not workingsprof MAN 页面中的示例不起作用
【发布时间】:2017-11-01 06:17:13
【问题描述】:

我尝试使用 Sprof 分析进行测试。我尝试了 MAN 页面示例:https://github.com/makelinux/examples/tree/master/sprof,但我看不到页面中提到的输出,我收到错误

Inconsistency detected by ld.so: dl-open.c: 707: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!


$ sprof -V
sprof (Ubuntu GLIBC 2.23-0ubuntu9) 2.23
 tried with Glibc-2.18 and 2.19 too

【问题讨论】:

标签: linux profiling glibc toolchain


【解决方案1】:

【讨论】:

  • 当然,我做到了
【解决方案2】:

该错误仅发生在 sprof 的特殊加载中,因此当使用 sprof 标志 __RTLD_SPROF 加载对象时简单地禁用断言允许我在使用 sprof 的同时避免可能干扰正常共享对象加载机制的更改。编辑 glibc/elf/dl-open.c:707 到:

  if (!(__glibc_unlikely (mode & __RTLD_SPROF))) {
   assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
  }

这适用于 glibc-2.20 并已发布到 https://sourceware.org/bugzilla/show_bug.cgi?id=22380

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-10
    • 2020-08-08
    • 2018-06-07
    • 2012-10-29
    • 2022-10-16
    相关资源
    最近更新 更多