gpt4 book ai didi

linux - 在 Debug模式下加载 libglib 时 "error: symbol lookup error: undefined symbol:"有什么意义?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:34 25 4
gpt4 key购买 nike

以下命令成功且没有错误:python3 -c 'from gi.repository import GLib'

但是,在调试一些与 glib 相关的段错误时,我使用 LD_DEBUG=files 运行相同的命令(在多个版本的 Debian 和 Ubuntu 上)并得到一堆与 libglib 和 libgobject 相关的错误.

这些是直接来自存储库的未修改库(有关详细信息,请参阅下面的“环境”)。

问题:这些错误的意义是什么?可以安全地忽略它们吗?如果可以,为什么?或者它们是否会在以后的程序中导致错误,如果是这样,是否有解决此问题的解决方法,或者这些包是否只是损坏并且必须通过修改源代码来修复?

错误示例:

 16306: opening file=/lib/x86_64-linux-gnu/libglib-2.0.so.0 [0]; direct_opencount=1
16306:
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_check_init (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_unload (fatal)

环境

  • 在具有 4 个不同发行版的 5 台不同计算机上进行了测试:Ubuntu 14.04、Ubuntu 15.10、Debian 8.4 和某人的自定义发行版
  • 相关软件包版本(仅适用于 15.10 Ubuntu 发行版):
    • python3 3.4.3-4ubuntu1(也:python3-all python3-all-dev python3-dbg python3-dev)
    • python3-gi 3.16.2-1build1(又名:python3-gi-cairo python3-gi-dbg)
    • gir1.2-glib-2.0:amd64 1.44.0-1
    • libgirepository-1.0-1:amd64 1.44.0-1
    • libglib2.0-0:am​​d64 2.46.2-1ubuntu2

完整命令输出:

$ LD_DEBUG=files python3 -c 'from gi.repository import GLib'
16306:
16306: file=libpthread.so.0 [0]; needed by python3 [0]
16306: file=libpthread.so.0 [0]; generating link map
16306: dynamic: 0x00007f74ce030d50 base: 0x00007f74cde19000 size: 0x000000000021c490
16306: entry: 0x00007f74cde1ff10 phdr: 0x00007f74cde19040 phnum: 9
16306:
16306:
16306: file=libdl.so.2 [0]; needed by python3 [0]
16306: file=libdl.so.2 [0]; generating link map
16306: dynamic: 0x00007f74cde17d88 base: 0x00007f74cdc15000 size: 0x0000000000203110
16306: entry: 0x00007f74cdc15ed0 phdr: 0x00007f74cdc15040 phnum: 9
16306:
16306:
16306: file=libutil.so.1 [0]; needed by python3 [0]
16306: file=libutil.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cdc13dc0 base: 0x00007f74cda12000 size: 0x0000000000202118
16306: entry: 0x00007f74cda12f10 phdr: 0x00007f74cda12040 phnum: 9
16306:
16306:
16306: file=librt.so.1 [0]; needed by python3 [0]
16306: file=librt.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cda10d70 base: 0x00007f74cd80a000 size: 0x0000000000207c18
16306: entry: 0x00007f74cd80c350 phdr: 0x00007f74cd80a040 phnum: 9
16306:
16306:
16306: file=libexpat.so.1 [0]; needed by python3 [0]
16306: file=libexpat.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cd808dc0 base: 0x00007f74cd5e1000 size: 0x0000000000228088
16306: entry: 0x00007f74cd5e4b90 phdr: 0x00007f74cd5e1040 phnum: 7
16306:
16306:
16306: file=libz.so.1 [0]; needed by python3 [0]
16306: file=libz.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cd5dfdd0 base: 0x00007f74cd3c6000 size: 0x000000000021a228
16306: entry: 0x00007f74cd3c8220 phdr: 0x00007f74cd3c6040 phnum: 7
16306:
16306:
16306: file=libm.so.6 [0]; needed by python3 [0]
16306: file=libm.so.6 [0]; generating link map
16306: dynamic: 0x00007f74cd3c4da8 base: 0x00007f74cd0c5000 size: 0x0000000000300158
16306: entry: 0x00007f74cd0ca580 phdr: 0x00007f74cd0c5040 phnum: 9
16306:
16306:
16306: file=libc.so.6 [0]; needed by python3 [0]
16306: file=libc.so.6 [0]; generating link map
16306: dynamic: 0x00007f74cd0beba0 base: 0x00007f74ccd1a000 size: 0x00000000003aaa20
16306: entry: 0x00007f74ccd3bc50 phdr: 0x00007f74ccd1a040 phnum: 10
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libc.so.6
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libm.so.6
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libz.so.1
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libexpat.so.1
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/librt.so.1
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libutil.so.1
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libdl.so.2
16306:
16306:
16306: initialize program: python3
16306:
16306:
16306: transferring control: python3
16306:
16306:
16306: file=/usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]; dynamically loaded by python3 [0]
16306: file=/usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]; generating link map
16306: dynamic: 0x00007f74ccb1f9e8 base: 0x00007f74cc8da000 size: 0x000000000024e648
16306: entry: 0x00007f74cc8ea4f0 phdr: 0x00007f74cc8da040 phnum: 7
16306:
16306:
16306: file=libgthread-2.0.so.0 [0]; needed by /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306: file=libgthread-2.0.so.0 [0]; generating link map
16306: dynamic: 0x00007f74cc8d8de8 base: 0x00007f74cc6d8000 size: 0x0000000000201048
16306: entry: 0x00007f74cc6d86d0 phdr: 0x00007f74cc6d8040 phnum: 7
16306:
16306:
16306: file=libgirepository-1.0.so.1 [0]; needed by /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306: file=libgirepository-1.0.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cc6d6ce0 base: 0x00007f74cc4a5000 size: 0x0000000000232688
16306: entry: 0x00007f74cc4ac380 phdr: 0x00007f74cc4a5040 phnum: 7
16306:
16306:
16306: file=libgobject-2.0.so.0 [0]; needed by /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306: file=libgobject-2.0.so.0 [0]; generating link map
16306: dynamic: 0x00007f74cc4a3b80 base: 0x00007f74cc252000 size: 0x0000000000252fc8
16306: entry: 0x00007f74cc25d330 phdr: 0x00007f74cc252040 phnum: 7
16306:
16306:
16306: file=libglib-2.0.so.0 [0]; needed by /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306: file=libglib-2.0.so.0 [0]; generating link map
16306: dynamic: 0x00007f74cc24fd40 base: 0x00007f74cbf43000 size: 0x000000000030e6a8
16306: entry: 0x00007f74cbf5d580 phdr: 0x00007f74cbf43040 phnum: 7
16306:
16306:
16306: file=libffi.so.6 [0]; needed by /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306: file=libffi.so.6 [0]; generating link map
16306: dynamic: 0x00007f74cbf41de8 base: 0x00007f74cbd3b000 size: 0x0000000000207668
16306: entry: 0x00007f74cbd3c870 phdr: 0x00007f74cbd3b040 phnum: 7
16306:
16306:
16306: file=libgmodule-2.0.so.0 [0]; needed by /usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 [0]
16306: file=libgmodule-2.0.so.0 [0]; generating link map
16306: dynamic: 0x00007f74cbd39de8 base: 0x00007f74cbb37000 size: 0x00000000002031b8
16306: entry: 0x00007f74cbb381b0 phdr: 0x00007f74cbb37040 phnum: 7
16306:
16306:
16306: file=libgio-2.0.so.0 [0]; needed by /usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 [0]
16306: file=libgio-2.0.so.0 [0]; generating link map
16306: dynamic: 0x00007f74cbb32c68 base: 0x00007f74cb7bd000 size: 0x0000000000379ac8
16306: entry: 0x00007f74cb7f0c50 phdr: 0x00007f74cb7bd040 phnum: 7
16306:
16306:
16306: file=libpcre.so.3 [0]; needed by /lib/x86_64-linux-gnu/libglib-2.0.so.0 [0]
16306: file=libpcre.so.3 [0]; generating link map
16306: dynamic: 0x00007f74cb7bbc90 base: 0x00007f74cb54f000 size: 0x000000000026d168
16306: entry: 0x00007f74cb550710 phdr: 0x00007f74cb54f040 phnum: 7
16306:
16306:
16306: file=libselinux.so.1 [0]; needed by /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 [0]
16306: file=libselinux.so.1 [0]; generating link map
16306: dynamic: 0x00007f74cb54bd68 base: 0x00007f74cb32a000 size: 0x00000000002248f0
16306: entry: 0x00007f74cb330310 phdr: 0x00007f74cb32a040 phnum: 8
16306:
16306:
16306: file=libresolv.so.2 [0]; needed by /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 [0]
16306: file=libresolv.so.2 [0]; generating link map
16306: dynamic: 0x00007f74cb326d88 base: 0x00007f74cb113000 size: 0x0000000000216a68
16306: entry: 0x00007f74cb116a90 phdr: 0x00007f74cb113040 phnum: 9
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libresolv.so.2
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libpcre.so.3
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libselinux.so.1
16306:
16306:
16306: calling init: /lib/x86_64-linux-gnu/libglib-2.0.so.0
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libffi.so.6
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1
16306:
16306:
16306: calling init: /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0
16306:
16306:
16306: calling init: /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so
16306:
16306: opening file=/usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]; direct_opencount=1
16306:
16306:
16306: file=/usr/lib/python3.4/lib-dynload/_opcode.cpython-34m-x86_64-linux-gnu.so [0]; dynamically loaded by python3 [0]
16306: file=/usr/lib/python3.4/lib-dynload/_opcode.cpython-34m-x86_64-linux-gnu.so [0]; generating link map
16306: dynamic: 0x00007f74caff0df8 base: 0x00007f74cadf0000 size: 0x00000000002011f0
16306: entry: 0x00007f74cadf0990 phdr: 0x00007f74cadf0040 phnum: 7
16306:
16306:
16306: calling init: /usr/lib/python3.4/lib-dynload/_opcode.cpython-34m-x86_64-linux-gnu.so
16306:
16306: opening file=/usr/lib/python3.4/lib-dynload/_opcode.cpython-34m-x86_64-linux-gnu.so [0]; direct_opencount=1
16306:
16306: opening file=/lib/x86_64-linux-gnu/libglib-2.0.so.0 [0]; direct_opencount=1
16306:
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_check_init (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_unload (fatal)
16306: opening file=/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 [0]; direct_opencount=1
16306:
16306: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_check_init (fatal)
16306: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: error: symbol lookup error: undefined symbol: g_module_unload (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_io_condition_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_loop_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_loop_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_loop_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_loop_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_context_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_context_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_context_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_main_context_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_source_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_io_channel_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_io_channel_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_io_channel_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_io_channel_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_pollfd_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_pollfd_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_pollfd_get_type (fatal)
16306: /lib/x86_64-linux-gnu/libglib-2.0.so.0: error: symbol lookup error: undefined symbol: g_pollfd_get_type (fatal)
16306:
16306: calling fini: python3 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libutil.so.1 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libexpat.so.1 [0]
16306:
16306:
16306: calling fini: /usr/lib/python3/dist-packages/gi/_gi.cpython-34m-x86_64-linux-gnu.so [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libm.so.6 [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 [0]
16306:
16306:
16306: calling fini: /usr/lib/x86_64-linux-gnu/libffi.so.6 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libglib-2.0.so.0 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libz.so.1 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libselinux.so.1 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libpcre.so.3 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libresolv.so.2 [0]
16306:
16306:
16306: calling fini: /usr/lib/python3.4/lib-dynload/_opcode.cpython-34m-x86_64-linux-gnu.so [0]
16306:
16306:
16306: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0]
16306:

最佳答案

我在使用 GLib 和 GStreamer 的 Python 应用程序中看到了同样的情况。我使用 LD_FILES=true 运行它并通过管道输出:

$ ./testlib.sh lib/hls.py 2>&1 | grep fatal |awk '{ print $(NF-1) }' | sort -u
__driDriverGetExtensions_swrast
g_io_channel_get_type
g_io_condition_get_type
g_main_context_get_type
g_main_loop_get_type
g_module_check_init
g_module_unload
g_pollfd_get_type
g_source_get_type

__driDriverGetExtensions_swrast() 似乎有点特别,但其他的都可以在Gnome Developer Boxed Types 上找到页或 Dyanmic Loading of Modules .

我仍然不确定这是否是我现在每次运行我的应用程序都会出现段错误的原因。 GModuleCheckInit() 的部分说:

If a module contains a function named g_module_check_init() it is called automatically when the module is loaded.

所以可能g_module_check_init()没有找到是正常的,相关报错信息无害。我想知道这是否是模块加载继续进行而不是立即退出并显示一些错误代码的原因。

在此期间,我自己构建并安装了所有 GStreamer 库和命令行工具,以获得最新的稳定版本 (GStreamer 1.10.4)。但是当它开始出现段错误时,我清除了/usr 下我能找到的所有 gstreamer 库,并安装了我的 Ubuntu 发行版 GStreamer 1.2 附带的版本。它仍然存在段错误,因此可能仍然缺少某些内容。

我知道这只是部分答案,但评论太长了。也许有人可以添加一些东西。

关于linux - 在 Debug模式下加载 libglib 时 "error: symbol lookup error: undefined symbol:"有什么意义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37580439/

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