簡體   English   中英

遠程嵌入式設備上具有corefile的GDB-如何獲取有關回溯的更多信息?

[英]GDB with corefile on remote embedded device - How to get more information about backtrace?

我有一個運行在嵌入式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)

您是否需要“設置solib-搜索路徑”或“設置sysroot”?

是個問題。 檢查linux-vdso.so.1所在的路徑(在您的設備上),並將其包含在solib-search-path中。 對於您的程序使用的其他共享庫,也是如此。 例如,如果某些共享庫在/ lib中,某些在/ usr / adowdy / lib中,而某些在/ usr / adowdy / arm / lib中,則可以這樣說:

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

(2)

警告:找不到與下一個線程庫匹配的libthread_db,線程調試將不可用。

也是一個問題。 看到這個問題的答案

(3)

分配65611字節失敗

是一個線索。 您是否有機會嘗試分配一個負數的字節(也許65536-65611 = -75字節)?

核心轉儲回溯也提供了一些無用的東西。

這並非完全沒有用。 堆棧跟蹤和來自應用程序的消息說了同樣的話:您的應用程序用完了內存( malloc無法分配65611字節)。

而更完整的堆棧會告訴你哪些特定的呼叫g_malloc失敗了,這是非常有可能在實踐中並不重要-如果這g_malloc沒有失敗,下一個會。

您可能發生內存泄漏,或者只是為系統允許的分配過多的內存。

您應該研究為解決此精確問題而構建的許多調試工具。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM