gpt4 book ai didi

c++ - 远程嵌入式设备上带有核心文件的 GDB - 如何获取有关回溯的更多信息?

转载 作者:太空宇宙 更新时间:2023-11-04 12:10:30 25 4
gpt4 key购买 nike

我有一个在嵌入式 imx6 板(yocto linux)上运行的 C++ 应用程序的核心转储。我可以将 gdb 放在盒子上并在终端中运行它来检查核心文件,就像这样:

gdb myApplication core.udpsrc256:src.1520419431.5526

我获得的信息极其有限,确实需要更多地了解导致核心转储的原因。我所拥有的只是应用程序的打印输出:

(myApplication:5526): GLib-ERROR **: ../../glib-2.46.2/glib/gmem.c:100: failed to allocate 65611 bytes
./run-app.sh: line 8: 5526 Trace/breakpoint trap (core dumped) XDG_RUNTIME_DIR=/run/user/root ./myApplication

核心转储回溯也提供了一些无用的东西。我需要了解导致此框架的堆栈中的更多内容:

#0  0x75ff1910 in raise () from /lib/libc.so.6
[Current thread is 1 (LWP 5533)]
(gdb)
(gdb)
(gdb) bt
#0 0x75ff1910 in raise () from /lib/libc.so.6
#1 0x6b169558 in g_logv () from /usr/lib/libglib-2.0.so.0
#2 0x6b169610 in g_log () from /usr/lib/libglib-2.0.so.0
#3 0x6b1681c4 in g_malloc () from /usr/lib/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

旁注——当我启动 gdb 时有一些警告:

GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-poky-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from qt5qmlvideo...done.

warning: exec file is newer than core file.
[New LWP 5533]
[New LWP 5526]
[New LWP 5531]
[New LWP 5528]
[New LWP 5534]
[New LWP 21064]
[New LWP 5536]
[New LWP 21065]
[New LWP 5532]
[New LWP 5527]
[New LWP 5530]
[New LWP 5537]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `./qt5qmlvideo -platform wayland'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0 0x75ff1910 in raise () from /lib/libc.so.6
[Current thread is 1 (LWP 5533)]
(gdb)

有人可以帮忙吗?我是否需要一些 gdb 警告的东西……或者我可以在其他一些可以提供更多输出的配置中重建我的应用程序及其依赖项吗?谢谢!

一些可能重要的注意事项-

这是一个运行 gstreamer 管道的多线程应用程序。许多 gstreamer 插件生成自己的线程,此管道中的线程之一是“udpsrc”。我想知道这是否是因为这些线程之一发生的故障是我无法获取详细信息的原因,但我想知道如何让它显示详细信息(如果可能的话)!

最佳答案

(1)

Do you need "set solib-search-path" or "set sysroot"?

是个问题。检查 linux-vdso.so.1 所在的路径(在您的设备上),并将其包含在 solib-search-path 中。对于您的程序使用的其他共享对象库也是如此。例如。如果一些共享对象库在/lib 中,一些在/usr/adowdy/lib 中,一些在/usr/adowdy/arm/lib 中,你可以说:

(gdb) set solib-search-path /lib:/usr/adowdy/lib:/usr/adowdy/arm/lib

(2)

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

也是一个问题。查看 this question 的答案

(3)

failed to allocate 65611 bytes

是一个线索。您是否有机会尝试分配负数的字节(可能是 65536 - 65611 = -75 字节)?

关于c++ - 远程嵌入式设备上带有核心文件的 GDB - 如何获取有关回溯的更多信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49163052/

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