Follow Excellent, Success will Chase you

0%

ABRT

ABRT (Automated Bug Reporting Tool) Daemon:

ABRT is an application, included in Fedora Linux Distribution, that is used to report bugs in the software packages whenever crash occurs. Due to this, ABRT also helps in creation of core dump files. Multiple packages may be needed to run various features of ABRT daemon, and their listing is as follows.

在linux调试程序,程序异常宕掉,没有core文件,很难定位问题。但是有了core文件就容易定位多了, 一般是可以通过在环境变量中设置ulimit -c unlimited

但是现场实施人员有时会忘记设置这条命令, 因此可以通过设置linux的abrt服务来实现。

系统:CentOS7

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Product Signing (GPG) Keys:
# https://access.redhat.com/security/team/key
#
OpenGPGCheck = no #捕获所有程序的崩溃信息

# Blacklisted packages
#
BlackList = nspluginwrapper, valgrind, strace, mono-core

# Process crashes in executables which do not belong to any package?
#
ProcessUnpackaged = yes #

# Blacklisted executable paths (shell patterns)
#
BlackListedPaths = /usr/share/doc/*, */example*, /usr/bin/nspluginviewer, /usr/lib/xulrunner-*/plugin-container

# interpreters names
Interpreters = python2, python2.7, python, python3, python3.3, perl, perl5.16.2

配置文件: /etc/abrt/abrt-action-save-package-data.conf

配置文件:/etc/abrt/abrt.conf

  • 配置参数解析

  • 重启服务

    1
    service abrtd restart
  • 查看状态

    1
    service abrtd status
1
sysctl -a | grep core_pattern

操作命令

查看文件的包

1
abrt-cli list
1
2
3
4
5
6
7
8
9
10
# abrt-cli list
id 3c0df29571be38a595b2034cfa631d3e6b569d34
reason: Unable to handle kernel NULL pointer dereference at virtual address 00000000
time: 2019年09月11日 星期三 20时26分26秒
uid: 0 (root)
count: 1
Directory: /var/spool/abrt/vmcore-127.0.0.1-2019-09-05-10:31:32

The Autoreporting feature is disabled. Please consider enabling it by issuing
'abrt-auto-reporting enabled' as a user with root privileges
1
2
3
# ls /var/spool/abrt/ccpp-2019-09-21-16:26:32-16439
abrt_version architecture cmdline coredump dso_list event_log exploitable hostname last_occurrence machineid open_fds os_release proc_pid_status reason time uid uuid
analyzer cgroup core_backtrace count environ executable global_pid kernel limits maps os_info pid pwd runlevel type username var_log_messages

删除文件包

1
abrt-cli rm <ccpp folder from list >
1
2
# abrt-cli rm /var/spool/abrt/vmcore-127.0.0.1-2019-09-05-10:31:32
rm '/var/spool/abrt/vmcore-127.0.0.1-2019-09-05-10:31:32'

参考

-------------本文结束感谢您的阅读-------------
  • 本文作者: Winddoing
  • 本文链接: https://winddoing.github.io/post/46984.html
  • 作者声明: 本博文为个人笔记, 由于个人能力有限,难免出现错误,欢迎大家批评指正。
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!