ldd 命令 libasan 未显示

发布于 2025-01-11 17:56:14 字数 680 浏览 5 评论 0原文

我的开发机器中有一个二进制文件 ldd 命令不显示 libasan。但是当我将相同的二进制文件复制到另一台生产机器时。 ldd 命令显示 libasan。我不确定这是怎么发生的。请帮我。

## DEV VM ##
cohesity - main: ldd <path>  | grep -i asan
cohesity - main: md5sum <path>
11152b37c616555eed06800ee499323a <path>
### Production machine ##
[support@suresh-test-005056af8cb9-node-1 ~]$ md5sum <path>
11152b37c616555eed06800ee499323a  <path>
[support@suresh-test-005056af8cb9-node-1 ~]$ ldd <path>  | grep -i asan
        libasan.so.4 => <path to libasan> (0x00007f72595e7000)
[support@suresh-test-005056af8cb9-node-1 ~]$ 

I have a binary in my dev machine ldd command doesn't show libasan. But when I copy the same binary to another production machine. ldd command shows libasan. I am not sure How this happens. Please help me.

## DEV VM ##
cohesity - main: ldd <path>  | grep -i asan
cohesity - main: md5sum <path>
11152b37c616555eed06800ee499323a <path>
### Production machine ##
[support@suresh-test-005056af8cb9-node-1 ~]$ md5sum <path>
11152b37c616555eed06800ee499323a  <path>
[support@suresh-test-005056af8cb9-node-1 ~]$ ldd <path>  | grep -i asan
        libasan.so.4 => <path to libasan> (0x00007f72595e7000)
[support@suresh-test-005056af8cb9-node-1 ~]$ 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

擦肩而过的背影 2025-01-18 17:56:14

我不确定这是如何发生的。

ldd 命令输出取决于以下几项:

  1. 您为其提供的二进制文件、
  2. 该二进制文件所依赖的所有共享库、递归
  3. 本地系统配置(对于搜索路径、任何预加载库)等)

通过将主二进制文件复制到另一台机器,您只能保证“步骤 1”是相同的。

很可能“步骤 2”中的共享库之一是在 node-1 上使用 -fsanitize=address 构建的,但不是在“dev VM”中构建的。

您可以使用 readelf -d /path/to/foo.so | 找出哪个库。 grep NEEDED.*libasan.so.4 在 ldd 输出中的每个库上。

I am not sure How this happens.

The ldd command output depends on a few things:

  1. the binary you give it
  2. all the shared libraries this binary depends on, recursively
  3. local system configuration (for search paths, any preload libraries, etc.)

By copying the main binary to a different machine, you only guaranteed that "step 1" is identical.

Chances are that one of the shared libraries in "step 2" has been built with -fsanitize=address on node-1, but not in "dev VM".

You can find out which library that is by using readelf -d /path/to/foo.so | grep NEEDED.*libasan.so.4 on each of the libraries in ldd output.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文