https://developer.toradex.com/knowledge-base/enable-and-analyze-coredumps-in-linux
https://linux-audit.com/understand-and-configure-core-dumps-work-on-linux/
打开imx的系统dumpcore日志并分析日志文件找到崩溃的代码行
ulimit -H -c 8192
ulimit -S -c 8192
echo 1 > /proc/sys/kernel/core_uses_pid
echo "/data/core-%e-%s-%u-%g-%p-%t" > /proc/sys/kernel/core_pattern
分析dumpcore日志 ,使用交叉编译工作提供的gdb, XXX为交叉编译环境根目录
YYY为dumocore日志路径,ZZZ为debug的可执行文件路径
cross-gdb -ex 'set sysroot XXX' -ex 'core-file YYY' ZZZ
../x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb -ex 'set sysroot .' -ex 'core-file ~/git_new/ledvance_professional_gateway_imx6ull/gateway-EU/Debug/core-gateway-EU-11-0-0-9133-1620442475' ~/git_new/ledvance_professional_gateway_imx6ull/gateway-EU/Debug/gateway-EU
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 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 "--host=x86_64-pokysdk-linux --target=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 /home/gateway/git_new/ledvance_professional_gateway_imx6ull/gateway-EU/Debug/gateway-EU...done.
[New LWP 9167]
[New LWP 9133]
[New LWP 9142]
[New LWP 9143]
[New LWP 9144]
[New LWP 9146]
[New LWP 9147]
[New LWP 9148]
[New LWP 9150]
[New LWP 9151]
[New LWP 9152]
[New LWP 9169]
[New LWP 9168]
warning: Could not load shared library symbols for /lib/libstdc++.so.6.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./gateway-EU'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 memcpy () at ../sysdeps/arm/armv7/multiarch/memcpy_impl.S:473
473 ../sysdeps/arm/armv7/multiarch/memcpy_impl.S: No such file or directory.
[Current thread is 1 (LWP 9167)]
killall -SIGSEGV gatewway-EU 终止进程并给它传递一个SIGSEGV信号