gpt4 book ai didi

valgrind 请求 debuginfo libc6-dbg

转载 作者:行者123 更新时间:2023-12-02 19:18:49 29 4
gpt4 key购买 nike

我已经查看了与此错误相关的答案。但是,我的问题是,一旦我有了 libc 的 debuginfo,我应该将该库放置在什么位置,以便 valgrind 能够看到它?

我已经下载了 valgrind 并针对我的目标环境进行了交叉编译。我尝试了以下所有不同的组合:

  1. 我将 libc 放在/lib 中,将 debuginfo 放在/lib/debug 中
  2. 将 debuginfo 重命名为 libc.debug
  3. 导出 VALGRIND_LIB 以包含/lib、/lib/debug

最后但并非最不重要的一点是,以下是实际错误:

==29946== Memcheck, a memory error detector
==29946== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29946== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==29946== Command: /bin/my_prog
==29946==

valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: strcmp
valgrind: in an object with soname matching: ld-linux-armhf.so.3
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux-armhf.so.3
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Note that if you are debugging a 32 bit process on a
valgrind: 64 bit system, you will need a corresponding 32 bit debuginfo
valgrind: package (e.g. libc6-dbg:i386).
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.

最佳答案

我遇到了同样的问题,解决方法如下:
将/lib 路径中的 ld-xx.so 替换为调试版本。

这是我的案例。我正在使用 Yocto 构建 rootfs,因此将 poky/build/tmp/work/xxxx/glibc/2.26-r0/image/lib/ld-2.26.so 从构建路径复制到 Linux FS路径 /lib,替换发布版本的原始 /lib/ld-2.26.so(和 ld-linux-armhf.so.3)

完成此操作后,valgrind 工作正常。

警告:在正在运行的系统上更换加载程序可能会导致系统变砖!这些步骤有效:

  • 上传新加载程序以定位到/lib 之外的路径
  • 将新加载程序标记为可执行文件 (chmod 755)
  • 复制(不要动!)旧加载程序
  • 将新加载程序复制到/lib

关于valgrind 请求 debuginfo libc6-dbg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47357952/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com