Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tool abrt-dump-journal-xorg #1075

Merged
merged 13 commits into from
Nov 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions abrt.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,9 @@ killall abrt-dbus >/dev/null 2>&1 || :
%{_initrddir}/abrt-xorg
%endif
%{_bindir}/abrt-dump-xorg
%{_bindir}/abrt-dump-journal-xorg
%{_mandir}/man1/abrt-dump-xorg.1*
%{_mandir}/man1/abrt-dump-journal-xorg.1*

%if %{?have_kexec_tools} == 1
%files addon-vmcore
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ MAN1_TXT += abrt-applet.txt
MAN1_TXT += abrt-dump-oops.txt
MAN1_TXT += abrt-dump-journal-core.txt
MAN1_TXT += abrt-dump-journal-oops.txt
MAN1_TXT += abrt-dump-journal-xorg.txt
MAN1_TXT += abrt-dump-xorg.txt
MAN1_TXT += abrt-auto-reporting.txt
MAN1_TXT += abrt-retrace-client.txt
Expand Down
4 changes: 2 additions & 2 deletions doc/abrt-action-analyze-xorg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ OPTIONS

FILES
-----
/etc/abrt/xorg.conf
List of modules which, when loaded, should make Xorg crashes non-reportable.
/etc/abrt/plugins/xorg.conf
Configuration file for ABRT's tools which work with Xorg crashes

AUTHORS
-------
Expand Down
82 changes: 82 additions & 0 deletions doc/abrt-dump-journal-xorg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
abrt-dump-journal-xorg(1)
=========================

NAME
----
abrt-dump-journal-xorg - Extract Xorg crashes from systemd-journal

SYNOPSIS
--------
'abrt-dump-journal-xorg' [-vsoxtf] [-e]/[-c CURSOR] [-d DIR]/[-D] [-j FILTER]

DESCRIPTION
-----------
This tool creates problem directory from Xorg crash extracted from
systemd-journal.
The tool can follow systemd-journal and extract Xorg crashes in time of their
occurrence.

The following start from the last seen cursor. If the last seen cursor file
does not exist, the following start by scanning the entire sytemd-journal or
from the end if '-e' option is specified.

Journal filter is required parameter and must be specified either by parameter
-j or in xorg.conf conf file.

FILES
-----
/var/lib/abrt/abrt-dump-journal-xorg.state::
State file where systemd-journal cursor to the last seen message is saved.

Configuration file
~~~~~~~~~~~~~~~~~~
The conf file is located in /etc/abrt/plugins/xorg.conf.
Configuration file lines should have 'PARAM = VALUE' format. The parameters for
abrt-dump-jounral-xorg are:

'JournalFilters'::
Specify list of comma separated filters which are used for searching Xorg
crashes in jounral (e.g. JournalFilters = _COMM=gdm-x-session, [...])

OPTIONS
-------
-v, --verbose::
Be more verbose. Can be given multiple times.

-s::
Log to syslog

-o::
Print found Xorg crashes on standard output

-d DIR::
Create new problem directory in DIR for every Xorg crash found

-D::
Same as -d DumpLocation, DumpLocation is specified in abrt.conf

-s CURSOR::
Starts scannig systemd-journal from CURSOR

-e::
Starts following systemd-journal from the end

-x::
Make the problem directory world readable. Usable only with -d/-D

-t::
Throttle problem directory creation to 1 per second

-f::
Follow systemd-journal

-j::
Set journal filter (may be given many times)

SEE ALSO
--------
abrt.conf(5), journalctl(1)

AUTHORS
-------
* ABRT team
11 changes: 11 additions & 0 deletions examples/xorg_journal_crash1.right
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
0: /usr/libexec/Xorg (OsLookupColor+0x139) [0x59ab89]
1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f2b13545b1f]
2: /lib64/libc.so.6 (__select_nocancel+0xa) [0x7f2b13609e7a]
3: /usr/libexec/Xorg (WaitForSomething+0x1c8) [0x593568]
4: /usr/libexec/Xorg (SendErrorToClient+0x111) [0x43a3a1]
5: /usr/libexec/Xorg (remove_fs_handlers+0x41b) [0x43e68b]
6: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f2b13531580]
7: /usr/libexec/Xorg (_start+0x29) [0x428a49]
8: ? (?+0x29) [0x29]
Received signal 11 sent by process 4025, uid 0

125 changes: 125 additions & 0 deletions examples/xorg_journal_crash1.test

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions examples/xorg_journal_crash2.right
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
0: /usr/libexec/Xorg (OsLookupColor+0x139) [0x59add9]
1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f61be425b1f]
2: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0xa9fc) [0x7f61b903116c]
3: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0xbe27) [0x7f61b90339a7]
4: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x31060) [0x7f61b907db00]
5: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x3fb73) [0x7f61b909b0c3]
6: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x3fe1a) [0x7f61b909b77a]
7: /usr/libexec/Xorg (DamageRegionAppend+0x3783) [0x525003]
8: /usr/libexec/Xorg (SendGraphicsExpose+0xeb3) [0x4340b3]
9: /usr/libexec/Xorg (SendErrorToClient+0x2df) [0x43684f]
10: /usr/libexec/Xorg (remove_fs_handlers+0x453) [0x43a893]
11: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f61be411580]
12: /usr/libexec/Xorg (_start+0x29) [0x424b79]
13: ? (?+0x29) [0x29]
Segmentation fault at address 0x7f61d93f6160

29 changes: 29 additions & 0 deletions examples/xorg_journal_crash2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(EE)
(EE) Backtrace:
(EE) 0: /usr/libexec/Xorg (OsLookupColor+0x139) [0x59add9]
(EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f61be425b1f]
(EE) 2: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0xa9fc) [0x7f61b903116c]
(EE) 3: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0xbe27) [0x7f61b90339a7]
(EE) 4: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x31060) [0x7f61b907db00]
(EE) 5: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x3fb73) [0x7f61b909b0c3]
(EE) 6: /usr/lib64/xorg/modules/drivers/intel_drv.so (_init+0x3fe1a) [0x7f61b909b77a]
(EE) 7: /usr/libexec/Xorg (DamageRegionAppend+0x3783) [0x525003]
(EE) 8: /usr/libexec/Xorg (SendGraphicsExpose+0xeb3) [0x4340b3]
(EE) 9: /usr/libexec/Xorg (SendErrorToClient+0x2df) [0x43684f]
(EE) 10: /usr/libexec/Xorg (remove_fs_handlers+0x453) [0x43a893]
(EE) 11: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f61be411580]
(EE) 12: /usr/libexec/Xorg (_start+0x29) [0x424b79]
(EE) 13: ? (?+0x29) [0x29]
(EE)
(EE) Segmentation fault at address 0x7f61d93f6160
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
(EE)
Please consult the Fedora Project support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/mikhail/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(II) AIGLX: Suspending AIGLX clients for VT switch
4 changes: 2 additions & 2 deletions init-scripts/abrt-xorg.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Description=ABRT Xorg log watcher
After=abrtd.service
Requisite=abrtd.service
ConditionPathExists=/var/log/Xorg.0.log

[Service]
ExecStart=/bin/sh -c 'exec /usr/bin/abrt-watch-log -F "`/usr/bin/abrt-dump-xorg -m`" /var/log/Xorg.0.log -- /usr/bin/abrt-dump-xorg -xD'
# systemd requires absolute paths to executables
ExecStart=/usr/bin/abrt-dump-journal-xorg -fxtD

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ src/plugins/abrt-watch-log.c
src/plugins/abrt-dump-oops.c
src/plugins/abrt-dump-journal-core.c
src/plugins/abrt-dump-journal-oops.c
src/plugins/abrt-dump-journal-xorg.c
src/plugins/abrt-dump-xorg.c
src/plugins/abrt-journal.c
src/plugins/abrt-retrace-client.c
Expand Down
33 changes: 33 additions & 0 deletions src/plugins/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bin_PROGRAMS = \
abrt-dump-journal-core \
abrt-dump-journal-oops \
abrt-dump-xorg \
abrt-dump-journal-xorg \
abrt-action-analyze-c \
abrt-action-analyze-python \
abrt-action-analyze-oops \
Expand Down Expand Up @@ -105,6 +106,7 @@ EXTRA_DIST = \
abrt-gdb-exploitable \
https-utils.h \
oops-utils.h \
xorg-utils.h \
abrt-journal.h \
post_report.xml.in \
abrt-action-analyze-ccpp-local.in
Expand Down Expand Up @@ -176,6 +178,18 @@ libabrt_journal_a_CFLAGS = \
$(GLIB_CFLAGS) \
-D_GNU_SOURCE

noinst_LIBRARIES += libxorg-utils.a
libxorg_utils_a_SOURCES = \
xorg-utils.c \
xorg-utils.h
libxorg_utils_a_CFLAGS = \
-I$(srcdir)/../include \
$(SYSTEMD_JOURNAL_CFLAGS) \
$(LIBREPORT_CFLAGS) \
$(GLIB_CFLAGS) \
-DDEFAULT_DUMP_DIR_MODE=$(DEFAULT_DUMP_DIR_MODE) \
-D_GNU_SOURCE

abrt_dump_journal_oops_SOURCES = \
oops-utils.c \
abrt-dump-journal-oops.c
Expand All @@ -194,6 +208,24 @@ abrt_dump_journal_oops_LDADD = \
$(SYSTEMD_JOURNAL_LIBS) \
../lib/libabrt.la

abrt_dump_journal_xorg_SOURCES = \
abrt-dump-journal-xorg.c
abrt_dump_journal_xorg_CPPFLAGS = \
-I$(srcdir)/../include \
-I$(srcdir)/../lib \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
-DDEFAULT_DUMP_DIR_MODE=$(DEFAULT_DUMP_DIR_MODE) \
-DVAR_STATE=\"$(VAR_STATE)\" \
-D_GNU_SOURCE
abrt_dump_journal_xorg_LDADD = \
libabrt-journal.a \
libxorg-utils.a \
$(GLIB_LIBS) \
$(LIBREPORT_LIBS) \
$(SYSTEMD_JOURNAL_LIBS) \
../lib/libabrt.la

abrt_dump_xorg_SOURCES = \
abrt-dump-xorg.c
abrt_dump_xorg_CPPFLAGS = \
Expand All @@ -204,6 +236,7 @@ abrt_dump_xorg_CPPFLAGS = \
-DDEFAULT_DUMP_DIR_MODE=$(DEFAULT_DUMP_DIR_MODE) \
-D_GNU_SOURCE
abrt_dump_xorg_LDADD = \
libxorg-utils.a \
$(GLIB_LIBS) \
$(LIBREPORT_LIBS) \
../lib/libabrt.la
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/abrt-dump-journal-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ main(int argc, char *argv[])
* Of cores, it is possible to override this when need while debugging.
*/
const char *const env_journal_filter = getenv("ABRT_DUMP_JOURNAL_CORE_DEBUG_FILTER");
static const char *coredump_journal_filter[2] = { 0 };
coredump_journal_filter[0] = (env_journal_filter ? env_journal_filter : "SYSLOG_IDENTIFIER=systemd-coredump");
log_debug("Using journal match: '%s'", coredump_journal_filter[0]);
GList *coredump_journal_filter = NULL;
coredump_journal_filter = g_list_append(coredump_journal_filter,
(env_journal_filter ? (gpointer)env_journal_filter : (gpointer)"SYSLOG_IDENTIFIER=systemd-coredump"));

abrt_journal_t *journal = NULL;
if (abrt_journal_new(&journal))
Expand All @@ -543,6 +543,8 @@ main(int argc, char *argv[])
if (abrt_journal_set_journal_filter(journal, coredump_journal_filter) < 0)
error_msg_and_die(_("Cannot filter systemd-journal to systemd-coredump data only"));

g_list_free(coredump_journal_filter);

if ((opts & OPT_e) && abrt_journal_seek_tail(journal) < 0)
error_msg_and_die(_("Cannot seek to the end of journal"));

Expand Down
8 changes: 5 additions & 3 deletions src/plugins/abrt-dump-journal-oops.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ int main(int argc, char *argv[])
oops_utils_flags |= ABRT_OOPS_PRINT_STDOUT;

const char *const env_journal_filter = getenv("ABRT_DUMP_JOURNAL_OOPS_DEBUG_FILTER");
static const char *kernel_journal_filter[2] = { 0 };
kernel_journal_filter[0] = (env_journal_filter ? env_journal_filter : "SYSLOG_IDENTIFIER=kernel");
log_debug("Using journal match: '%s'", kernel_journal_filter[0]);
GList *kernel_journal_filter = NULL;
kernel_journal_filter = g_list_append(kernel_journal_filter,
(env_journal_filter ? (gpointer)env_journal_filter : (gpointer)"SYSLOG_IDENTIFIER=kernel"));

abrt_journal_t *journal = NULL;
if ((opts & OPT_J))
Expand All @@ -287,6 +287,8 @@ int main(int argc, char *argv[])
if (abrt_journal_set_journal_filter(journal, kernel_journal_filter) < 0)
error_msg_and_die(_("Cannot filter systemd-journal to kernel data only"));

g_list_free(kernel_journal_filter);

if ((opts & OPT_e) && abrt_journal_seek_tail(journal) < 0)
error_msg_and_die(_("Cannot seek to the end of journal"));

Expand Down