[RETRACE-SERVER PATCH] Include floating-point registers in the backtrace
by Martin Milata
Related to rhbz#812204.
http://sourceware.org/gdb/current/onlinedocs/gdb/Registers.html#Registers
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
src/lib/retrace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/retrace.py b/src/lib/retrace.py
index 3f69b1e..cf950f7 100644
--- a/src/lib/retrace.py
+++ b/src/lib/retrace.py
@@ -399,7 +399,7 @@ def run_gdb(savedir):
"-ex 'info sharedlib' "
"-ex 'print (char*)__abort_msg' "
"-ex 'print (char*)__glib_assert_msg' "
- "-ex 'info registers' "
+ "-ex 'info all-registers' "
"-ex 'disassemble'" % executable)
copyin = call(["/usr/bin/mock", "--configdir", savedir, "--copyin",
--
1.8.3.1
10 years, 8 months
[ABRT PATCH] specfile: make addon-pstoreoops obsolete addon-uefioops
by Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
abrt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/abrt.spec.in b/abrt.spec.in
index 210416c..07c50eb 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -212,6 +212,7 @@ Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: abrt-libs = %{version}-%{release}
Requires: abrt-addon-kerneloops
+Obsoletes: abrt-addon-uefioops
%description addon-pstoreoops
This package contains plugin for collecting kernel oopses from pstore storage.
--
1.8.1.4
10 years, 8 months
[ABRT PATCH v2] abrt-dump-oops: add -t option which slows down problem creation. rhbz#902398.
by Denys Vlasenko
Use this option in watch logger services.
User comment from rhbz#902398:
"You can't expect users to report more than 10 issues produced at the same time,
but you can expect, that users want to continue using their workstation
and that's impossible, when abrt generates tons of notifications,
eats the whole CPU and makes the computer slow as hell. In that case
any tries to process as many backtraces as possible doesn't make any
sense and you should ignore them because you can't reliably process
them because of the lack of resources."
Option -t has two-fold effect: first, it adds an 1 second pause after each
problem dir is created. This makes post-create and deduplication job easier,
and generally prevents stampede effect on the CPU load.
Second, if more than MAX_DUMPED_DD_COUNT oopses were seen,
then abrt-dump-oops will sleep for N^2 seconds, where N is the number
of seen "extra" oopses, but no more than 15 minutes.
Previously, the sleep was linear and it was unconditional).
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
doc/abrt-dump-oops.txt | 5 ++++-
init-scripts/abrt-oops | 2 +-
init-scripts/abrt-oops.service | 2 +-
src/plugins/abrt-dump-oops.c | 29 +++++++++++++++++++++--------
4 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/doc/abrt-dump-oops.txt b/doc/abrt-dump-oops.txt
index f63e53a..cdb985c 100644
--- a/doc/abrt-dump-oops.txt
+++ b/doc/abrt-dump-oops.txt
@@ -7,7 +7,7 @@ abrt-dump-oops - Extract oops from FILE (or standard input)
SYNOPSIS
--------
-'abrt-dump-oops' [-vusoxm] [-d DIR]/[-D] [FILE]
+'abrt-dump-oops' [-vusoxtm] [-d DIR]/[-D] [FILE]
DESCRIPTION
-----------
@@ -37,6 +37,9 @@ OPTIONS
-x::
Make the problem directory world readable. Usable only with -d/-D
+-t::
+ Throttle problem directory creation to 1 per second
+
-m::
Print search string(s) for 'abrt-watch-log' to stdout and exit
diff --git a/init-scripts/abrt-oops b/init-scripts/abrt-oops
index 76b7722..3dca949 100644
--- a/init-scripts/abrt-oops
+++ b/init-scripts/abrt-oops
@@ -40,7 +40,7 @@ start() {
# Scan dmesg
dmesg | abrt-dump-oops -xD
# Watch and scan /var/log/messages
- setsid abrt-watch-log -F "`abrt-dump-oops -m`" /var/log/messages -- abrt-dump-oops -xD </dev/null >/dev/null 2>&1 &
+ setsid abrt-watch-log -F "`abrt-dump-oops -m`" /var/log/messages -- abrt-dump-oops -xtD </dev/null >/dev/null 2>&1 &
$dry_run || touch -- "$LOCK"
return $RETVAL
}
diff --git a/init-scripts/abrt-oops.service b/init-scripts/abrt-oops.service
index b8b2b81..d8ac028 100644
--- a/init-scripts/abrt-oops.service
+++ b/init-scripts/abrt-oops.service
@@ -5,7 +5,7 @@ Requisite=abrtd.service
[Service]
# TODO: do we really need absolute paths here?
-ExecStart=/bin/sh -c '/bin/dmesg | /usr/bin/abrt-dump-oops -xD; exec /usr/bin/abrt-watch-log -F "`/usr/bin/abrt-dump-oops -m`" /var/log/messages -- /usr/bin/abrt-dump-oops -xD'
+ExecStart=/bin/sh -c '/bin/dmesg | /usr/bin/abrt-dump-oops -xD; exec /usr/bin/abrt-watch-log -F "`/usr/bin/abrt-dump-oops -m`" /var/log/messages -- /usr/bin/abrt-dump-oops -xtD'
[Install]
WantedBy=multi-user.target
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index d39edec..706ef3d 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -20,12 +20,13 @@
#include "libabrt.h"
/* How many problem dirs to create at most?
- * Also causes cooldown sleep if exceeded -
+ * Also causes cooldown sleep with -t if exceeded -
* useful when called from a log watcher.
*/
#define MAX_DUMPED_DD_COUNT 5
static bool world_readable_dump = false;
+static bool throttle_dd_creation = false;
static const char *debug_dumps_dir = ".";
#define MAX_SCAN_BLOCK (4*1024*1024)
@@ -161,9 +162,9 @@ static void save_oops_data_in_dump_dir(struct dump_dir *dd, char *oops, const ch
/* returns number of errors */
static unsigned create_oops_dump_dirs(GList *oops_list, unsigned oops_cnt)
{
- unsigned countdown = MAX_DUMPED_DD_COUNT + 1; /* do not report hundreds of oopses */
+ unsigned countdown = MAX_DUMPED_DD_COUNT; /* do not report hundreds of oopses */
- VERB1 log("Saving %u oopses as dump dirs", oops_cnt >= countdown ? countdown-1 : oops_cnt);
+ VERB1 log("Saving %u oopses as problem dirs", oops_cnt >= countdown ? countdown : oops_cnt);
char *cmdline_str = xmalloc_fopen_fgetline_fclose("/proc/cmdline");
char *fips_enabled = xmalloc_fopen_fgetline_fclose("/proc/sys/crypto/fips_enabled");
@@ -185,7 +186,7 @@ static unsigned create_oops_dump_dirs(GList *oops_list, unsigned oops_cnt)
pid_t my_pid = getpid();
unsigned idx = 0;
unsigned errors = 0;
- while (idx < oops_cnt && --countdown != 0)
+ while (idx < oops_cnt)
{
char base[sizeof("oops-YYYY-MM-DD-hh:mm:ss-%lu-%lu") + 2 * sizeof(long)*3];
sprintf(base, "oops-%s-%lu-%lu", iso_date, (long)my_pid, (long)idx);
@@ -214,6 +215,12 @@ static unsigned create_oops_dump_dirs(GList *oops_list, unsigned oops_cnt)
errors++;
free(path);
+
+ if (--countdown == 0)
+ break;
+
+ if (dd && throttle_dd_creation)
+ sleep(1);
}
free(cmdline_str);
@@ -249,7 +256,8 @@ int main(int argc, char **argv)
OPT_D = 1 << 4,
OPT_u = 1 << 5,
OPT_x = 1 << 6,
- OPT_m = 1 << 7,
+ OPT_t = 1 << 7,
+ OPT_m = 1 << 8,
};
char *problem_dir = NULL;
/* Keep enum above and order of options below in sync! */
@@ -264,6 +272,7 @@ int main(int argc, char **argv)
OPT_BOOL( 'D', NULL, NULL, _("Same as -d DumpLocation, DumpLocation is specified in abrt.conf")),
OPT_STRING('u', NULL, &problem_dir, "PROBLEM", _("Save the extracted information in PROBLEM")),
OPT_BOOL( 'x', NULL, NULL, _("Make the problem directory world readable")),
+ OPT_BOOL( 't', NULL, NULL, _("Throttle problem directory creation to 1 per second")),
OPT_BOOL( 'm', NULL, NULL, _("Print search string(s) to stdout and exit")),
OPT_END()
};
@@ -299,6 +308,7 @@ int main(int argc, char **argv)
xmove_fd(xopen(argv[0], O_RDONLY), STDIN_FILENO);
world_readable_dump = (opts & OPT_x);
+ throttle_dd_creation = (opts & OPT_t);
unsigned errors = 0;
GList *oops_list = NULL;
scan_syslog_file(&oops_list, STDIN_FILENO);
@@ -366,7 +376,7 @@ int main(int argc, char **argv)
error_msg(_("Can't update the problem: more than one oops found"));
break;
}
- }
+ }
}
list_free_with_free(oops_list);
//oops_list = NULL;
@@ -375,9 +385,12 @@ int main(int argc, char **argv)
* (because log watcher waits to us to terminate)
* and possibly prevents dreaded "abrt storm".
*/
- if (oops_cnt > MAX_DUMPED_DD_COUNT)
+ int unreported_cnt = oops_cnt - MAX_DUMPED_DD_COUNT;
+ if (unreported_cnt > 0 && throttle_dd_creation)
{
- sleep(oops_cnt - MAX_DUMPED_DD_COUNT);
+ /* Quadratic throttle time growth, but careful to not overflow in "n*n" */
+ int n = unreported_cnt > 30 ? 30 : unreported_cnt;
+ sleep(n * n); /* max 15 mins */
}
return errors;
--
1.8.1.4
10 years, 8 months
[ABRT PATCH 1/2] abrt-handle-event: add check for missing crash thread
by Jakub Filak
Just to be sure. satyr should always find a crash thread.
Related to rhbz#997076
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/daemon/abrt-handle-event.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index 73e53f7..ff1232e 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -33,6 +33,8 @@ static struct sr_stacktrace *corebt = NULL;
static char *analyzer = NULL;
static char *crash_dump_dup_name = NULL;
+static void dup_corebt_fini(void);
+
static char* load_backtrace(const struct dump_dir *dd)
{
const char *filename = FILENAME_BACKTRACE;
@@ -48,6 +50,15 @@ static char* load_backtrace(const struct dump_dir *dd)
static int core_backtrace_is_duplicate(struct sr_stacktrace *bt1,
const char *bt2_text)
{
+ struct sr_thread *thread1 = sr_stacktrace_find_crash_thread(bt1);
+
+ if (thread1 == NULL)
+ {
+ VERB1 log("New stacktrace has no crash thread, disabling core stacktrace deduplicate");
+ dup_corebt_fini();
+ return 0;
+ }
+
int result;
char *error_message;
struct sr_stacktrace *bt2 = sr_stacktrace_parse(sr_abrt_type_from_analyzer(analyzer),
@@ -59,9 +70,15 @@ static int core_backtrace_is_duplicate(struct sr_stacktrace *bt1,
return 0;
}
- struct sr_thread *thread1 = sr_stacktrace_find_crash_thread(bt1);
struct sr_thread *thread2 = sr_stacktrace_find_crash_thread(bt2);
+ if (thread2 == NULL)
+ {
+ VERB1 log("Failed to get crash thread, considering it not duplicate");
+ result = 0;
+ goto end;
+ }
+
int length2 = sr_thread_frame_count(thread2);
if (length2 <= 0)
--
1.8.3.1
10 years, 8 months
[ABRT PATCH 1/2] Mass rename uefioops->pstoreoops part 1. rhbz#949721
by Denys Vlasenko
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
Makefile.am | 4 +-
doc/Makefile.am | 4 +-
doc/abrt-harvest-pstoreoops.txt | 25 +++++
doc/abrt-harvest-uefioops.txt | 25 -----
doc/abrt-merge-pstoreoops.txt | 30 ++++++
doc/abrt-merge-uefioops.txt | 30 ------
init-scripts/abrt-pstoreoops | 79 ++++++++++++++
init-scripts/abrt-pstoreoops.service | 13 +++
init-scripts/abrt-uefioops | 79 --------------
init-scripts/abrt-uefioops.service | 13 ---
po/POTFILES.in | 2 +-
src/hooks/Makefile.am | 18 ++--
src/hooks/abrt-harvest-pstoreoops.in | 44 ++++++++
src/hooks/abrt-harvest-uefioops.in | 44 --------
src/hooks/abrt-merge-pstoreoops.c | 148 ++++++++++++++++++++++++++
src/hooks/abrt-merge-uefioops.c | 148 --------------------------
tests/runtests/aux/test_order | 4 +-
tests/runtests/aux/test_order.rhel7 | 2 +-
tests/runtests/pstoreoops-harvest/PURPOSE | 3 +
tests/runtests/pstoreoops-harvest/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops-harvest/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops-harvest/runtest.sh | 52 +++++++++
tests/runtests/pstoreoops/dmesg-efi-1 | 29 +++++
tests/runtests/pstoreoops/dmesg-efi-2 | 14 +++
tests/runtests/pstoreoops/runtest.sh | 56 ++++++++++
tests/runtests/uefioops-harvest/PURPOSE | 3 -
tests/runtests/uefioops-harvest/dmesg-efi-1 | 29 -----
tests/runtests/uefioops-harvest/dmesg-efi-2 | 14 ---
tests/runtests/uefioops-harvest/runtest.sh | 52 ---------
tests/runtests/uefioops/dmesg-efi-1 | 29 -----
tests/runtests/uefioops/dmesg-efi-2 | 14 ---
tests/runtests/uefioops/runtest.sh | 56 ----------
32 files changed, 553 insertions(+), 553 deletions(-)
create mode 100644 doc/abrt-harvest-pstoreoops.txt
delete mode 100644 doc/abrt-harvest-uefioops.txt
create mode 100644 doc/abrt-merge-pstoreoops.txt
delete mode 100644 doc/abrt-merge-uefioops.txt
create mode 100644 init-scripts/abrt-pstoreoops
create mode 100644 init-scripts/abrt-pstoreoops.service
delete mode 100644 init-scripts/abrt-uefioops
delete mode 100644 init-scripts/abrt-uefioops.service
create mode 100644 src/hooks/abrt-harvest-pstoreoops.in
delete mode 100644 src/hooks/abrt-harvest-uefioops.in
create mode 100644 src/hooks/abrt-merge-pstoreoops.c
delete mode 100644 src/hooks/abrt-merge-uefioops.c
create mode 100644 tests/runtests/pstoreoops-harvest/PURPOSE
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops-harvest/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops-harvest/runtest.sh
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-1
create mode 100644 tests/runtests/pstoreoops/dmesg-efi-2
create mode 100755 tests/runtests/pstoreoops/runtest.sh
delete mode 100644 tests/runtests/uefioops-harvest/PURPOSE
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops-harvest/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops-harvest/runtest.sh
delete mode 100644 tests/runtests/uefioops/dmesg-efi-1
delete mode 100644 tests/runtests/uefioops/dmesg-efi-2
delete mode 100755 tests/runtests/uefioops/runtest.sh
diff --git a/Makefile.am b/Makefile.am
index a67659e..f0b0e1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,7 @@ if HAVE_SYSTEMD
init-scripts/abrt-oops.service \
init-scripts/abrt-xorg.service \
init-scripts/abrt-vmcore.service \
- init-scripts/abrt-uefioops.service \
+ init-scripts/abrt-pstoreoops.service \
init-scripts/abrt-upload-watch.service
else
sysv_initdir = $(sysconfdir)/rc.d/init.d/
@@ -49,7 +49,7 @@ else
init-scripts/abrt-oops \
init-scripts/abrt-xorg \
init-scripts/abrt-vmcore \
- init-scripts/abrt-uefioops \
+ init-scripts/abrt-pstoreoops \
init-scripts/abrt-upload-watch
endif
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e0c50ff..74834b0 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -21,9 +21,9 @@ MAN1_TXT += abrt-dump-oops.txt
MAN1_TXT += abrt-dump-xorg.txt
MAN1_TXT += abrt-retrace-client.txt
MAN1_TXT += abrt-handle-upload.txt
-MAN1_TXT += abrt-harvest-uefioops.txt
+MAN1_TXT += abrt-harvest-pstoreoops.txt
MAN1_TXT += abrt-harvest-vmcore.txt
-MAN1_TXT += abrt-merge-uefioops.txt
+MAN1_TXT += abrt-merge-pstoreoops.txt
MAN1_TXT += abrt-server.txt
MAN1_TXT += abrt-dedup-client.txt
MAN1_TXT += abrt-cli.txt
diff --git a/doc/abrt-harvest-pstoreoops.txt b/doc/abrt-harvest-pstoreoops.txt
new file mode 100644
index 0000000..1c8f6aa
--- /dev/null
+++ b/doc/abrt-harvest-pstoreoops.txt
@@ -0,0 +1,25 @@
+abrt-harvest-pstoreoops(1)
+==========================
+
+NAME
+----
+abrt-harvest-pstoreoops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
+
+SYNOPSIS
+--------
+'abrt-harvest-pstoreoops'
+
+DESCRIPTION
+-----------
+This script is meant to be run once at system startup after abrtd is up and
+running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
+creates ABRT problem directories from them, then removes the files (pstore
+storage is a limited resource).
+
+SEE ALSO
+--------
+abrt-merge-pstoreoops(1)
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-harvest-uefioops.txt b/doc/abrt-harvest-uefioops.txt
deleted file mode 100644
index efd6f3f..0000000
--- a/doc/abrt-harvest-uefioops.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-abrt-harvest-uefioops(1)
-======================
-
-NAME
-----
-abrt-harvest-uefioops - Reconstruct oops from /sys/fs/pstore/* files, create ABRT problems and remove the files
-
-SYNOPSIS
---------
-'abrt-harvest-uefioops'
-
-DESCRIPTION
------------
-This script is meant to be run once at system startup after abrtd is up and
-running. It scans /sys/fs/pstore/*, reconstructs oops text(s) from these files,
-creates ABRT problem directories from them, then removes the files (UEFI
-storage is a limited resource).
-
-SEE ALSO
---------
-abrt-merge-uefioops(1)
-
-AUTHORS
--------
-* ABRT team
diff --git a/doc/abrt-merge-pstoreoops.txt b/doc/abrt-merge-pstoreoops.txt
new file mode 100644
index 0000000..2d1c31d
--- /dev/null
+++ b/doc/abrt-merge-pstoreoops.txt
@@ -0,0 +1,30 @@
+abrt-merge-pstoreoops(1)
+========================
+
+NAME
+----
+abrt-merge-pstoreoops - Scans files for split oops message. Can print and/or delete them.
+
+SYNOPSIS
+--------
+'abrt-merge-pstoreoops' [-v] [-od] FILE...
+
+DESCRIPTION
+-----------
+This tool takes list of files, reads all of the files, scans them for split
+oops messages and join oops parts to original oops message.
+
+OPTIONS
+-------
+-o::
+ Print found oopses
+
+-d::
+ Delete files with found oopses
+
+-v, --verbose::
+ Be more verbose. Can be given multiple times.
+
+AUTHORS
+-------
+* ABRT team
diff --git a/doc/abrt-merge-uefioops.txt b/doc/abrt-merge-uefioops.txt
deleted file mode 100644
index 8f7de86..0000000
--- a/doc/abrt-merge-uefioops.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-abrt-merge-uefioops(1)
-====================
-
-NAME
-----
-abrt-merge-uefioops - Scans files for split oops message. Can print and/or delete them.
-
-SYNOPSIS
---------
-'abrt-merge-uefioops' [-v] [-od] FILE...
-
-DESCRIPTION
------------
-This tool takes list of files, reads all of the files, scans them for split
-oops messages and join oops parts to original oops message.
-
-OPTIONS
--------
--o::
- Print found oopses
-
--d::
- Delete files with found oopses
-
--v, --verbose::
- Be more verbose. Can be given multiple times.
-
-AUTHORS
--------
-* ABRT team
diff --git a/init-scripts/abrt-pstoreoops b/init-scripts/abrt-pstoreoops
new file mode 100644
index 0000000..fe9890d
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops
@@ -0,0 +1,79 @@
+#!/bin/bash
+# Harvest UEFI-saved oopses for ABRT
+#
+# chkconfig: 35 82 16
+# description: Collects pstore-saved oopses for ABRT
+### BEGIN INIT INFO
+# Provides: abrt-pstoreoops
+# Required-Start: $abrtd
+# Default-Stop: 0 1 2 6
+# Default-Start: 3 5
+# Short-Description: Collects pstore-saved oopses for ABRT
+# Description: Collects pstore-saved oopses for ABRT
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+LOCK="/var/lock/subsys/abrt-pstoreoops"
+HARVEST_CMD="/usr/sbin/abrt-harvest-pstoreoops"
+
+RETVAL=0
+
+check() {
+ # Check that we're a privileged user
+ [ "`id -u`" = 0 ] || exit 4
+}
+
+start() {
+ check
+ "$HARVEST_CMD"
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch -- "$LOCK"
+ return $RETVAL
+}
+
+stop() {
+ check
+ rm -f -- "$LOCK"
+ return 0
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+reload)
+ reload
+ ;;
+force-reload)
+ echo "$0: Unimplemented feature."
+ RETVAL=3
+ ;;
+restart)
+ restart
+ ;;
+condrestart)
+ test -f "$LOCK" && restart
+ ;;
+status)
+ test -f "$LOCK" && RETVAL=0 || RETVAL=3
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
+ RETVAL=2
+esac
+
+exit $RETVAL
diff --git a/init-scripts/abrt-pstoreoops.service b/init-scripts/abrt-pstoreoops.service
new file mode 100644
index 0000000..50cb6ee
--- /dev/null
+++ b/init-scripts/abrt-pstoreoops.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Collect UEFI-saved oopses for ABRT
+After=abrtd.service
+Requisite=abrtd.service
+ConditionDirectoryNotEmpty=/sys/fs/pstore
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/abrt-harvest-pstoreoops
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/init-scripts/abrt-uefioops b/init-scripts/abrt-uefioops
deleted file mode 100644
index 663e24a..0000000
--- a/init-scripts/abrt-uefioops
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-# Harvest UEFI-saved oopses for ABRT
-#
-# chkconfig: 35 82 16
-# description: Collects UEFI-saved oopses for ABRT
-### BEGIN INIT INFO
-# Provides: abrt-uefioops
-# Required-Start: $abrtd
-# Default-Stop: 0 1 2 6
-# Default-Start: 3 5
-# Short-Description: Collects UEFI-saved oopses for ABRT
-# Description: Collects UEFI-saved oopses for ABRT
-### END INIT INFO
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-LOCK="/var/lock/subsys/abrt-uefioops"
-HARVEST_CMD="/usr/sbin/abrt-harvest-uefioops"
-
-RETVAL=0
-
-check() {
- # Check that we're a privileged user
- [ "`id -u`" = 0 ] || exit 4
-}
-
-start() {
- check
- "$HARVEST_CMD"
- RETVAL=$?
- [ $RETVAL -eq 0 ] && touch -- "$LOCK"
- return $RETVAL
-}
-
-stop() {
- check
- rm -f -- "$LOCK"
- return 0
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-case "$1" in
-start)
- start
- ;;
-stop)
- stop
- ;;
-reload)
- reload
- ;;
-force-reload)
- echo "$0: Unimplemented feature."
- RETVAL=3
- ;;
-restart)
- restart
- ;;
-condrestart)
- test -f "$LOCK" && restart
- ;;
-status)
- test -f "$LOCK" && RETVAL=0 || RETVAL=3
- ;;
-*)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
- RETVAL=2
-esac
-
-exit $RETVAL
diff --git a/init-scripts/abrt-uefioops.service b/init-scripts/abrt-uefioops.service
deleted file mode 100644
index 1481782..0000000
--- a/init-scripts/abrt-uefioops.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Collect UEFI-saved oopses for ABRT
-After=abrtd.service
-Requisite=abrtd.service
-ConditionDirectoryNotEmpty=/sys/fs/pstore
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/abrt-harvest-uefioops
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8d22e35..cd0a887 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -40,7 +40,7 @@ src/plugins/collect_xsession_errors.xml.in
src/plugins/https-utils.c
src/plugins/bodhi.c
-src/hooks/abrt-merge-uefioops.c
+src/hooks/abrt-merge-pstoreoops.c
src/cli/abrt-cli.c
src/cli/list.c
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index dfa791c..567da6a 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -13,10 +13,10 @@ dist_pluginsconf_DATA = \
sbin_SCRIPTS = \
abrt-install-ccpp-hook \
abrt-harvest-vmcore \
- abrt-harvest-uefioops
+ abrt-harvest-pstoreoops
bin_PROGRAMS = \
- abrt-merge-uefioops
+ abrt-merge-pstoreoops
libexec_PROGRAMS = abrt-hook-ccpp
@@ -36,10 +36,10 @@ abrt_hook_ccpp_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
-# abrt-merge-uefioops
-abrt_merge_uefioops_SOURCES = \
- abrt-merge-uefioops.c
-abrt_merge_uefioops_CPPFLAGS = \
+# abrt-merge-pstoreoops
+abrt_merge_pstoreoops_SOURCES = \
+ abrt-merge-pstoreoops.c
+abrt_merge_pstoreoops_CPPFLAGS = \
-I$(srcdir)/../include \
-I$(srcdir)/../lib \
-DVAR_RUN=\"$(VAR_RUN)\" \
@@ -48,7 +48,7 @@ abrt_merge_uefioops_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
-D_GNU_SOURCE
-abrt_merge_uefioops_LDADD = \
+abrt_merge_pstoreoops_LDADD = \
../lib/libabrt.la \
$(LIBREPORT_LIBS)
@@ -61,7 +61,7 @@ pyhook_PYTHON = \
EXTRA_DIST = abrt_exception_handler.py.in \
abrt-install-ccpp-hook.in \
abrt_harvest_vmcore.py.in \
- abrt-harvest-uefioops.in
+ abrt-harvest-pstoreoops.in
CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) $(man1_MANS)
@@ -90,7 +90,7 @@ abrt-harvest-vmcore: abrt_harvest_vmcore.py.in
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
-abrt-harvest-uefioops: abrt-harvest-uefioops.in
+abrt-harvest-pstoreoops: abrt-harvest-pstoreoops.in
sed -e s,\@CONF_DIR\@,\$(CONF_DIR)\,g \
-e s,\@DEFAULT_DUMP_LOCATION\@,$(DEFAULT_DUMP_LOCATION),g \
$< >$@
diff --git a/src/hooks/abrt-harvest-pstoreoops.in b/src/hooks/abrt-harvest-pstoreoops.in
new file mode 100644
index 0000000..050f103
--- /dev/null
+++ b/src/hooks/abrt-harvest-pstoreoops.in
@@ -0,0 +1,44 @@
+#! /usr/bin/python
+#
+# This script is meant to be run once at system startup
+# It scans /sys/fs/pstore/*, reconstructs oops text(s)
+# from these files, creates ABRT problem directories from them,
+# then removes the files (UEFI storage is a limited resource).
+#
+
+import os
+import sys
+from subprocess import Popen
+
+if __name__ == "__main__":
+ # need to allow setting the pstore oops storage dir
+ # to make this script testable
+ pstoredir = "/sys/fs/pstore"
+ dryrun = False
+
+ for arg in sys.argv:
+ if arg == "dryrun":
+ dryrun = True
+ continue
+
+ if arg.startswith("--pstoredir"):
+ pstoredir = arg.split('=')[1]
+
+ try:
+ os.chdir(pstoredir)
+ except OSError, ex:
+ # silently ignore if the pstore doesn't exist, because that usually
+ # means that we're on the system where pstore boot is not supported
+ sys.stderr.write("Can't chdir to {0}: {1}".format(pstoredir, ex))
+ sys.exit(0)
+
+ merge_status = Popen(
+ ["-c", "abrt-merge-pstoreoops -o * | abrt-dump-oops {0}"
+ .format("-o" if dryrun else "-D")],
+ shell=True,
+ bufsize=-1
+ ).wait()
+ if merge_status == 0:
+ Popen(["abrt-merge-pstoreoops -d *"], shell=True, bufsize=-1)
+ else:
+ sys.stderr.write("Failed to merge pstore oops")
diff --git a/src/hooks/abrt-harvest-uefioops.in b/src/hooks/abrt-harvest-uefioops.in
deleted file mode 100644
index 6c3f18a..0000000
--- a/src/hooks/abrt-harvest-uefioops.in
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /usr/bin/python
-#
-# This script is meant to be run once at system startup
-# It scans /sys/fs/pstore/*, reconstructs oops text(s)
-# from these files, creates ABRT problem directories from them,
-# then removes the files (UEFI storage is a limited resource).
-#
-
-import os
-import sys
-from subprocess import Popen
-
-if __name__ == "__main__":
- # need to allow setting the uefi oops storage dir
- # to make this script testable
- uefidir = "/sys/fs/pstore"
- dryrun = False
-
- for arg in sys.argv:
- if arg == "dryrun":
- dryrun = True
- continue
-
- if arg.startswith("--uefidir"):
- uefidir = arg.split('=')[1]
-
- try:
- os.chdir(uefidir)
- except OSError, ex:
- # silently ignore if the pstore doesn't exist, because that usually
- # means that we're on the system where uefi boot is not supported
- sys.stderr.write("Can't chdir to {0}: {1}".format(uefidir, ex))
- sys.exit(0)
-
- merge_status = Popen(
- ["-c", "abrt-merge-uefioops -o * | abrt-dump-oops {0}"
- .format("-o" if dryrun else "-D")],
- shell=True,
- bufsize=-1
- ).wait()
- if merge_status == 0:
- Popen(["abrt-merge-uefioops -d *"], shell=True, bufsize=-1)
- else:
- sys.stderr.write("Failed to merge uefi oops")
diff --git a/src/hooks/abrt-merge-pstoreoops.c b/src/hooks/abrt-merge-pstoreoops.c
new file mode 100644
index 0000000..6fc3109
--- /dev/null
+++ b/src/hooks/abrt-merge-pstoreoops.c
@@ -0,0 +1,148 @@
+/*
+ Copyright (C) 2013 Red Hat, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+#include "libabrt.h"
+
+struct oops_text {
+ unsigned panic_no;
+ unsigned part_no;
+ const char *filename;
+ char *text;
+};
+
+static
+struct oops_text *parse_file(const char *filename)
+{
+ FILE *fp = fopen(filename, "r");
+ if (!fp)
+ return NULL;
+
+ char buffer[16 * 1024];
+
+ struct oops_text *ot = NULL;
+
+ if (!fgets(buffer, sizeof(buffer), fp))
+ goto ret;
+ unsigned n1, n2;
+ int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
+ if (n != 2)
+ goto ret;
+
+ ot = xzalloc(sizeof(*ot));
+ ot->filename = filename;
+ ot->panic_no = n1;
+ ot->part_no = n2;
+
+ size_t sz = fread(buffer, 1, sizeof(buffer), fp);
+ ot->text = strndup(buffer, sz);
+
+ ret:
+ fclose(fp);
+ return ot;
+}
+
+static
+int compare_oops_texts(const void *a, const void *b)
+{
+ struct oops_text *aa = *(struct oops_text **)a;
+ struct oops_text *bb = *(struct oops_text **)b;
+ if (aa->panic_no < bb->panic_no)
+ return -1;
+ if (aa->panic_no > bb->panic_no)
+ return 1;
+ if (aa->part_no < bb->part_no)
+ return -1;
+ return (aa->part_no > bb->part_no);
+}
+
+int main(int argc, char **argv)
+{
+ /* I18n */
+ setlocale(LC_ALL, "");
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ abrt_init(argv);
+
+ /* Can't keep these strings/structs static: _() doesn't support that */
+ const char *program_usage_string = _(
+ "& [-v] [-od] FILE...\n"
+ "\n"
+ "Scans files for split oops message. Can print and/or delete them."
+ );
+ enum {
+ OPT_v = 1 << 0,
+ OPT_o = 1 << 1,
+ OPT_d = 1 << 2,
+ };
+ /* Keep enum above and order of options below in sync! */
+ struct options program_options[] = {
+ OPT__VERBOSE(&g_verbose),
+ OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
+ OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
+ OPT_END()
+ };
+ unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
+
+ export_abrt_envvars(0);
+
+ struct oops_text **v = xzalloc(sizeof(v[0]));
+ int i = 0;
+
+ while (*argv)
+ {
+ v[i] = parse_file(*argv);
+ if (v[i])
+ {
+ v = xrealloc(v, (++i + 1) * sizeof(v[0]));
+ v[i] = NULL;
+ }
+ argv++;
+ }
+
+ if (i == 0) /* nothing was found */
+ return 0;
+
+ qsort(v, i, sizeof(v[0]), compare_oops_texts);
+
+ if (opts & OPT_o)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ fputs(cur_oops->text, stdout);
+ vv++;
+ }
+ }
+
+ if (opts & OPT_d)
+ {
+ struct oops_text **vv = v;
+ while (*vv)
+ {
+ struct oops_text *cur_oops = *vv;
+ if (unlink(cur_oops->filename) != 0)
+ perror_msg("Can't unlink '%s'", cur_oops->filename);
+ vv++;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/hooks/abrt-merge-uefioops.c b/src/hooks/abrt-merge-uefioops.c
deleted file mode 100644
index 6fc3109..0000000
--- a/src/hooks/abrt-merge-uefioops.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- Copyright (C) 2013 Red Hat, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-#include "libabrt.h"
-
-struct oops_text {
- unsigned panic_no;
- unsigned part_no;
- const char *filename;
- char *text;
-};
-
-static
-struct oops_text *parse_file(const char *filename)
-{
- FILE *fp = fopen(filename, "r");
- if (!fp)
- return NULL;
-
- char buffer[16 * 1024];
-
- struct oops_text *ot = NULL;
-
- if (!fgets(buffer, sizeof(buffer), fp))
- goto ret;
- unsigned n1, n2;
- int n = sscanf(buffer, "Panic#%u Part%u\n", &n1, &n2);
- if (n != 2)
- goto ret;
-
- ot = xzalloc(sizeof(*ot));
- ot->filename = filename;
- ot->panic_no = n1;
- ot->part_no = n2;
-
- size_t sz = fread(buffer, 1, sizeof(buffer), fp);
- ot->text = strndup(buffer, sz);
-
- ret:
- fclose(fp);
- return ot;
-}
-
-static
-int compare_oops_texts(const void *a, const void *b)
-{
- struct oops_text *aa = *(struct oops_text **)a;
- struct oops_text *bb = *(struct oops_text **)b;
- if (aa->panic_no < bb->panic_no)
- return -1;
- if (aa->panic_no > bb->panic_no)
- return 1;
- if (aa->part_no < bb->part_no)
- return -1;
- return (aa->part_no > bb->part_no);
-}
-
-int main(int argc, char **argv)
-{
- /* I18n */
- setlocale(LC_ALL, "");
-#if ENABLE_NLS
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-#endif
-
- abrt_init(argv);
-
- /* Can't keep these strings/structs static: _() doesn't support that */
- const char *program_usage_string = _(
- "& [-v] [-od] FILE...\n"
- "\n"
- "Scans files for split oops message. Can print and/or delete them."
- );
- enum {
- OPT_v = 1 << 0,
- OPT_o = 1 << 1,
- OPT_d = 1 << 2,
- };
- /* Keep enum above and order of options below in sync! */
- struct options program_options[] = {
- OPT__VERBOSE(&g_verbose),
- OPT_BOOL('o', NULL, NULL, _("Print found oopses")),
- OPT_BOOL('d', NULL, NULL, _("Delete files with found oopses")),
- OPT_END()
- };
- unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
-
- export_abrt_envvars(0);
-
- struct oops_text **v = xzalloc(sizeof(v[0]));
- int i = 0;
-
- while (*argv)
- {
- v[i] = parse_file(*argv);
- if (v[i])
- {
- v = xrealloc(v, (++i + 1) * sizeof(v[0]));
- v[i] = NULL;
- }
- argv++;
- }
-
- if (i == 0) /* nothing was found */
- return 0;
-
- qsort(v, i, sizeof(v[0]), compare_oops_texts);
-
- if (opts & OPT_o)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- fputs(cur_oops->text, stdout);
- vv++;
- }
- }
-
- if (opts & OPT_d)
- {
- struct oops_text **vv = v;
- while (*vv)
- {
- struct oops_text *cur_oops = *vv;
- if (unlink(cur_oops->filename) != 0)
- perror_msg("Can't unlink '%s'", cur_oops->filename);
- vv++;
- }
- }
-
- return 0;
-}
diff --git a/tests/runtests/aux/test_order b/tests/runtests/aux/test_order
index 44d8fa6..c29ae19 100644
--- a/tests/runtests/aux/test_order
+++ b/tests/runtests/aux/test_order
@@ -67,8 +67,8 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
-uefioops-harvest
+pstoreoops
+pstoreoops-harvest
# - more or less destructive tests
diff --git a/tests/runtests/aux/test_order.rhel7 b/tests/runtests/aux/test_order.rhel7
index 935b8fd..ab388be 100644
--- a/tests/runtests/aux/test_order.rhel7
+++ b/tests/runtests/aux/test_order.rhel7
@@ -66,7 +66,7 @@ bz783450-setuid-core-owned-by-root
systemd-init
-uefioops
+pstoreoops
# - more or less destructive tests
diff --git a/tests/runtests/pstoreoops-harvest/PURPOSE b/tests/runtests/pstoreoops-harvest/PURPOSE
new file mode 100644
index 0000000..ed8ba9c
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of pstoreoops-harvest
+Description: Tests the pstore oops init script
+Author: Jiri Moskovcak <jmoskovc(a)redhat.com>
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-1 b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops-harvest/dmesg-efi-2 b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops-harvest/runtest.sh b/tests/runtests/pstoreoops-harvest/runtest.sh
new file mode 100755
index 0000000..c5fc1cb
--- /dev/null
+++ b/tests/runtests/pstoreoops-harvest/runtest.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Tests abrt pstore harvesting
+# Author: Jiri Moskovcak <jmoskovc(a)redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "Harvesting oops"
+ rlRun "abrt-harvest-pstoreoops --pstoredir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/pstoreoops/dmesg-efi-1 b/tests/runtests/pstoreoops/dmesg-efi-1
new file mode 100644
index 0000000..416e660
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-1
@@ -0,0 +1,29 @@
+Panic#2 Part1
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm] Setting GART location based on new memorymap
+<4> [drm] Loading RS690/RS740 Microcode
+<4> [drm] Num pipes: 1
+<4> [drm] writeback test succeeded in 1 usecs
+<4> [drm] Num pipes: 1
+<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
+<4> [drm] Loading RS690/RS740 Microcode
+<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
+<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
+<4> *pde = 6f5c6067
+<4> Oops: 0000 [#1] SMP.
+<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
+<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
+<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
+<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
+<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
+<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
+<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
+<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
+<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
+<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
+<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/pstoreoops/dmesg-efi-2 b/tests/runtests/pstoreoops/dmesg-efi-2
new file mode 100644
index 0000000..ef564c6
--- /dev/null
+++ b/tests/runtests/pstoreoops/dmesg-efi-2
@@ -0,0 +1,14 @@
+Panic#2 Part2
+<4> Call Trace:
+<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
+<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
+<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
+<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
+<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
+<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
+<4> [<c049b460>] sys_ioctl+0x40/0x5c
+<4> [<c0403c76>] syscall_call+0x7/0xb
+<4> =======================
+<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
+<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
+<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/pstoreoops/runtest.sh b/tests/runtests/pstoreoops/runtest.sh
new file mode 100755
index 0000000..d8a7075
--- /dev/null
+++ b/tests/runtests/pstoreoops/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# runtest.sh of pstoreoops
+# Description: Test abrt-merge-pstoreoops
+# Author: Denys Vlasenko <dvlasenk(a)redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+. /usr/share/beakerlib/beakerlib.sh
+. ../aux/lib.sh
+
+TEST="pstoreoops"
+PACKAGE="abrt"
+
+rlJournalStart
+ rlPhaseStartSetup
+ TmpDir=$(mktemp -d)
+ cp -R -- dmesg-efi-* "$TmpDir"
+ pushd -- "$TmpDir"
+ rlPhaseEnd
+
+ rlPhaseStartTest "merge pstore oops"
+ rlRun "abrt-merge-pstoreoops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
+ rlPhaseEnd
+
+ rlPhaseStartTest "delete pstore oops"
+ rlRun "abrt-merge-pstoreoops -d dmesg-efi-*" 0 "Testing deleting"
+ rlAssertNotExists dmesg-efi-1
+ rlAssertNotExists dmesg-efi-2
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rm -rf -- "$TmpDir"
+ rlPhaseEnd
+ rlJournalPrintText
+rlJournalEnd
diff --git a/tests/runtests/uefioops-harvest/PURPOSE b/tests/runtests/uefioops-harvest/PURPOSE
deleted file mode 100644
index d198c99..0000000
--- a/tests/runtests/uefioops-harvest/PURPOSE
+++ /dev/null
@@ -1,3 +0,0 @@
-PURPOSE of uefioops-harvest
-Description: Tests the uefi oops init script
-Author: Jiri Moskovcak <jmoskovc(a)redhat.com>
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-1 b/tests/runtests/uefioops-harvest/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops-harvest/dmesg-efi-2 b/tests/runtests/uefioops-harvest/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops-harvest/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops-harvest/runtest.sh b/tests/runtests/uefioops-harvest/runtest.sh
deleted file mode 100755
index 5a01fac..0000000
--- a/tests/runtests/uefioops-harvest/runtest.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Tests abrt uefi harvesting
-# Author: Jiri Moskovcak <jmoskovc(a)redhat.com>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "Harvesting oops"
- rlRun "abrt-harvest-uefioops --uefidir=$TmpDir dryrun 2>&1 | grep 'abrt-dump-oops: Found oopses: 1'" 0 "Testing harvesting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
diff --git a/tests/runtests/uefioops/dmesg-efi-1 b/tests/runtests/uefioops/dmesg-efi-1
deleted file mode 100644
index 416e660..0000000
--- a/tests/runtests/uefioops/dmesg-efi-1
+++ /dev/null
@@ -1,29 +0,0 @@
-Panic#2 Part1
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm] Setting GART location based on new memorymap
-<4> [drm] Loading RS690/RS740 Microcode
-<4> [drm] Num pipes: 1
-<4> [drm] writeback test succeeded in 1 usecs
-<4> [drm] Num pipes: 1
-<4> [drm:radeon_set_igpgart] *ERROR* Unable to useIGP GART table size 32768
-<4> [drm] Loading RS690/RS740 Microcode
-<4> BUG: unable to handle kernel NULL pointer dereference at 00000000
-<4> IP: [<f88dec25>] :radeon:radeon_cp_init_ring_buffer+0x90/0x302
-<4> *pde = 6f5c6067
-<4> Oops: 0000 [#1] SMP.
-<4> Modules linked in: r8169 mii fuse nfsd lockd nfs_acl auth_rpcgss exportfs bridge stp bnep sco l2cap bl
-<4> Pid: 8003, comm: Xorg Not tainted (2.6.27.9-159.fc10.i686 #1)
-<4> EIP: 0060:[<f88dec25>] EFLAGS: 00213246 CPU: 1
-<4> EIP is at radeon_cp_init_ring_buffer+0x90/0x302 [radeon]
-<4> EAX: 00000000 EBX: f78b4000 ECX: f78b4000 EDX: 00000000
-<4> ESI: f5dbe800 EDI: 00006458 EBP: f0a0cf18 ESP: f0a0cf08
-<4> DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
-<4> Process Xorg (pid: 8003, ti=f0a0c000 task=f2380000 task.ti=f0a0c000)
-<4> Stack: f0a0cf18 f78b4000 f5dbe800 00006458 f0a0cf28 f88e11c7 f8911a24 00000000
-<4> f0a0cf4c f88745f8 f30c3ba0 f5dbe800 f88e114a f5dbe828 f890fd78 f097ac00
-<4> 00000000 f0a0cf68 c049b1c0 00000000 00006458 f097ac00 f097ac00 00000000
diff --git a/tests/runtests/uefioops/dmesg-efi-2 b/tests/runtests/uefioops/dmesg-efi-2
deleted file mode 100644
index ef564c6..0000000
--- a/tests/runtests/uefioops/dmesg-efi-2
+++ /dev/null
@@ -1,14 +0,0 @@
-Panic#2 Part2
-<4> Call Trace:
-<4> [<f88e11c7>] radeon_cp_resume+0x7d/0xbc [radeon]
-<4> [<f88745f8>] drm_ioctl+0x1b0/0x225 [drm]
-<4> [<f88e114a>] radeon_cp_resume+0x0/0xbc [radeon]
-<4> [<c049b1c0>] vfs_ioctl+0x50/0x69
-<4> [<c049b414>] do_vfs_ioctl+0x23b/0x247
-<4> [<c0460a56>] audit_syscall_entry+0xf9/0x123
-<4> [<c049b460>] sys_ioctl+0x40/0x5c
-<4> [<c0403c76>] syscall_call+0x7/0xb
-<4> =======================
-<4> Code: 66 31 d2 09 c2 89 d8 e8 fc e7 ff ff 8b 83 cc 00 00 00 8b 53 34 03 10 8b 86 70 02 00 00 2b 50 44
-<4> EIP: [<f88dec25>] radeon_cp_init_ring_buffer+0x90/0x302 [radeon] SS:ESP 0068:f0a0cf08
-<4> ---[ end trace 81e3cf9431f7af0c ]---
diff --git a/tests/runtests/uefioops/runtest.sh b/tests/runtests/uefioops/runtest.sh
deleted file mode 100755
index 0daed4e..0000000
--- a/tests/runtests/uefioops/runtest.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# runtest.sh of uefioops
-# Description: Test abrt-merge-uefioops
-# Author: Denys Vlasenko <dvlasenk(a)redhat.com>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
-#
-# This program is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be
-# useful, but WITHOUT ANY WARRANTY; without even the implied
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-# PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see http://www.gnu.org/licenses/.
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-. /usr/share/beakerlib/beakerlib.sh
-. ../aux/lib.sh
-
-TEST="uefioops"
-PACKAGE="abrt"
-
-rlJournalStart
- rlPhaseStartSetup
- TmpDir=$(mktemp -d)
- cp -R -- dmesg-efi-* "$TmpDir"
- pushd -- "$TmpDir"
- rlPhaseEnd
-
- rlPhaseStartTest "merge uefi oops"
- rlRun "abrt-merge-uefioops -o dmesg-efi-* | grep 'Process Xorg'" 0 "Testing merging"
- rlPhaseEnd
-
- rlPhaseStartTest "delete uefi oops"
- rlRun "abrt-merge-uefioops -d dmesg-efi-*" 0 "Testing deleting"
- rlAssertNotExists dmesg-efi-1
- rlAssertNotExists dmesg-efi-2
- rlPhaseEnd
-
- rlPhaseStartCleanup
- popd
- rm -rf -- "$TmpDir"
- rlPhaseEnd
- rlJournalPrintText
-rlJournalEnd
--
1.8.1.4
10 years, 8 months
[ABRT PATCH] spec: create type element for problem dirs where it doesn't exist - rhbz#958968
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
abrt.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/abrt.spec.in b/abrt.spec.in
index 5f646e5..11faf2e 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -492,6 +492,8 @@ if [ $1 -eq 0 ] ; then
fi
%posttrans
+# update the old problem dirs to contain "type" element
+abrtdir=$(grep "DumpLocation" /etc/abrt/abrt.conf | cut -d'=' -f2 | tr -d ' '); cd $abrtdir 2>/dev/null && for i in `find . -name "analyzer" 2>/dev/null`; do len=${#i};cp "$i" "${i:0:$len-9}/type"; done;
service abrtd condrestart >/dev/null 2>&1 || :
%posttrans addon-ccpp
--
1.8.3.1
10 years, 8 months
[ABRT PATCH 1/5] factor out GIO channel helper method
by Jakub Filak
Related to #657
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/daemon/abrtd.c | 25 ++++---------------------
src/dbus/abrt-dbus.c | 2 +-
src/include/abrt-dbus.h | 4 ----
src/lib/Makefile.am | 1 +
src/lib/abrt_glib.c | 20 +++++++++++++++++++-
src/lib/abrt_glib.h | 30 ++++++++++++++++++++++++++++++
src/lib/problem_api_dbus.c | 1 +
7 files changed, 56 insertions(+), 27 deletions(-)
create mode 100644 src/lib/abrt_glib.h
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
index 2af55a5..124421a 100644
--- a/src/daemon/abrtd.c
+++ b/src/daemon/abrtd.c
@@ -24,6 +24,7 @@
#include <sys/inotify.h>
#include <sys/ioctl.h> /* ioctl(FIONREAD) */
+#include "abrt_glib.h"
#include "libabrt.h"
@@ -71,24 +72,6 @@ static guint add_watch_or_die(GIOChannel *channel, unsigned condition, GIOFunc f
return r;
}
-static GIOChannel *my_io_channel_unix_new(int fd)
-{
- GIOChannel *ch = g_io_channel_unix_new(fd);
-
- /* Need to set the encoding otherwise we get:
- * "Invalid byte sequence in conversion input".
- * According to manual "NULL" is safe for binary data.
- */
- GError *error = NULL;
- g_io_channel_set_encoding(ch, NULL, &error);
- if (error)
- perror_msg_and_die("Can't set encoding on gio channel: %s", error->message);
-
- g_io_channel_set_close_on_unref(ch, TRUE);
-
- return ch;
-}
-
static void increment_child_count(void)
{
if (++child_count >= MAX_CLIENT_COUNT)
@@ -427,7 +410,7 @@ static void dumpsocket_init(void)
if (chmod(SOCKET_FILE, SOCKET_PERMISSION) != 0)
perror_msg_and_die("chmod '%s'", SOCKET_FILE);
- channel_socket = my_io_channel_unix_new(socketfd);
+ channel_socket = abrt_gio_channel_unix_new(socketfd);
channel_id_socket = add_watch_or_die(channel_socket, G_IO_IN | G_IO_PRI | G_IO_HUP, server_socket_cb);
}
@@ -753,7 +736,7 @@ int main(int argc, char** argv)
* on inotify read forever. Must set fd to non-blocking:
*/
ndelay_on(inotify_fd);
- channel_inotify = my_io_channel_unix_new(inotify_fd);
+ channel_inotify = abrt_gio_channel_unix_new(inotify_fd);
/*
* glib's read buffering must be disabled, or else
* FIONREAD-reported "available data" sizes and sizes of reads
@@ -767,7 +750,7 @@ int main(int argc, char** argv)
/* Add an event source which waits for INT/TERM signal */
VERB1 log("Adding signal pipe watch to glib main loop");
- channel_signal = my_io_channel_unix_new(s_signal_pipe[0]);
+ channel_signal = abrt_gio_channel_unix_new(s_signal_pipe[0]);
channel_id_signal_event = add_watch_or_die(channel_signal,
G_IO_IN | G_IO_PRI | G_IO_HUP,
handle_signal_cb);
diff --git a/src/dbus/abrt-dbus.c b/src/dbus/abrt-dbus.c
index ab48d1c..6dce3cb 100644
--- a/src/dbus/abrt-dbus.c
+++ b/src/dbus/abrt-dbus.c
@@ -5,7 +5,7 @@
#include <grp.h>
#include "libabrt.h"
#include "abrt-polkit.h"
-#include "abrt-dbus.h"
+#include "abrt_glib.h"
#include <libreport/dump_dir.h>
#include "problem_api.h"
diff --git a/src/include/abrt-dbus.h b/src/include/abrt-dbus.h
index 93f5fb1..898dd94 100644
--- a/src/include/abrt-dbus.h
+++ b/src/include/abrt-dbus.h
@@ -5,8 +5,4 @@
#define ABRT_DBUS_OBJECT "/org/freedesktop/problems"
#define ABRT_DBUS_IFACE "org.freedesktop.problems"
-GList *string_list_from_variant(GVariant *variant);
-
-GVariant *variant_from_string_list(const GList *strings);
-
#endif /* ABRTDBUS_H_ */
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index b75cc23..c5a6e2f 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -11,6 +11,7 @@ libabrt_la_SOURCES = \
notify_new_path.c \
kernel.c \
abrt_glib.c \
+ abrt_glib.h \
migrate_dirs.c \
check_recent_crash_file.c \
problem_api.c \
diff --git a/src/lib/abrt_glib.c b/src/lib/abrt_glib.c
index bf88d4c..1104ca2 100644
--- a/src/lib/abrt_glib.c
+++ b/src/lib/abrt_glib.c
@@ -16,7 +16,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <glib-2.0/glib.h>
+#include "abrt_glib.h"
#include "libabrt.h"
GList *string_list_from_variant(GVariant *variant)
@@ -54,3 +54,21 @@ GVariant *variant_from_string_list(const GList *strings)
return variant;
}
+
+GIOChannel *abrt_gio_channel_unix_new(int fd)
+{
+ GIOChannel *ch = g_io_channel_unix_new(fd);
+
+ /* Need to set the encoding otherwise we get:
+ * "Invalid byte sequence in conversion input".
+ * According to manual "NULL" is safe for binary data.
+ */
+ GError *error = NULL;
+ g_io_channel_set_encoding(ch, NULL, &error);
+ if (error)
+ perror_msg_and_die("Can't set encoding on gio channel: %s", error->message);
+
+ g_io_channel_set_close_on_unref(ch, TRUE);
+
+ return ch;
+}
diff --git a/src/lib/abrt_glib.h b/src/lib/abrt_glib.h
new file mode 100644
index 0000000..5c1fe4f
--- /dev/null
+++ b/src/lib/abrt_glib.h
@@ -0,0 +1,30 @@
+/*
+ Copyright (C) 2013 ABRT team
+ Copyright (C) 2013 RedHat Inc
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+#ifndef _ABRT_GLIB_H_
+#define _ABRT_GLIB_H_
+
+#include <glib-2.0/glib.h>
+
+GList *string_list_from_variant(GVariant *variant);
+
+GVariant *variant_from_string_list(const GList *strings);
+
+GIOChannel *abrt_gio_channel_unix_new(int fd);
+
+#endif /*_ABRT_GLIB_H_*/
diff --git a/src/lib/problem_api_dbus.c b/src/lib/problem_api_dbus.c
index 04f4069..784a43f 100644
--- a/src/lib/problem_api_dbus.c
+++ b/src/lib/problem_api_dbus.c
@@ -17,6 +17,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include "abrt_glib.h"
#include "libabrt.h"
static GDBusProxy *get_dbus_proxy(void)
--
1.8.3.1
10 years, 8 months
[SATYR PATCH] include raw kerneloops text in uReport; closes #87
by Michal Toman
Signed-off-by: Michal Toman <mtoman(a)redhat.com>
---
include/koops/stacktrace.h | 5 +++++
lib/koops_stacktrace.c | 15 +++++++++++++
python/py_koops_stacktrace.c | 8 +++++++
python/py_koops_stacktrace.h | 1 +
tests/koops_stacktrace.at | 51 +++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 79 insertions(+), 1 deletion(-)
diff --git a/include/koops/stacktrace.h b/include/koops/stacktrace.h
index 85bc755..6fcc7d6 100644
--- a/include/koops/stacktrace.h
+++ b/include/koops/stacktrace.h
@@ -78,6 +78,11 @@ struct sr_koops_stacktrace
* @brief Call trace. It might be NULL as it is not mandatory.
*/
struct sr_koops_frame *frames;
+
+ /**
+ * @brief Raw kerneloops text.
+ */
+ char *raw_oops;
};
/**
diff --git a/lib/koops_stacktrace.c b/lib/koops_stacktrace.c
index 4ba74db..449f20b 100644
--- a/lib/koops_stacktrace.c
+++ b/lib/koops_stacktrace.c
@@ -129,6 +129,7 @@ sr_koops_stacktrace_free(struct sr_koops_stacktrace *stacktrace)
}
free(stacktrace->version);
+ free(stacktrace->raw_oops);
free(stacktrace);
}
@@ -144,6 +145,9 @@ sr_koops_stacktrace_dup(struct sr_koops_stacktrace *stacktrace)
if (result->version)
result->version = sr_strdup(result->version);
+ if (result->raw_oops)
+ result->raw_oops = sr_strdup(result->raw_oops);
+
return result;
}
@@ -291,6 +295,9 @@ sr_koops_stacktrace_parse(const char **input,
struct sr_koops_frame *frame;
bool parsed_ip = false;
+ /* Include the raw kerneloops text */
+ stacktrace->raw_oops = sr_strdup(*input);
+
/* Looks for the "Tainted: " line in the whole input */
parse_taint_flags(local_input, stacktrace);
@@ -444,6 +451,14 @@ sr_koops_stacktrace_to_json(struct sr_koops_stacktrace *stacktrace)
{
struct sr_strbuf *strbuf = sr_strbuf_new();
+ /* Raw oops. */
+ if (stacktrace->raw_oops)
+ {
+ sr_strbuf_append_str(strbuf, ", \"raw_oops\": ");
+ sr_json_append_escaped(strbuf, stacktrace->raw_oops);
+ sr_strbuf_append_str(strbuf, "\n");
+ }
+
/* Kernel version. */
if (stacktrace->version)
{
diff --git a/python/py_koops_stacktrace.c b/python/py_koops_stacktrace.c
index 0057cb1..27b222d 100644
--- a/python/py_koops_stacktrace.c
+++ b/python/py_koops_stacktrace.c
@@ -46,6 +46,7 @@ static PyGetSetDef
koops_stacktrace_getset[] =
{
{ (char*)"modules", sr_py_koops_stacktrace_get_modules, sr_py_koops_stacktrace_set_modules, (char*)b_modules_doc, NULL },
+ { (char*)"raw_oops", sr_py_koops_stacktrace_get_raw_oops, NULL, (char*)b_taint_flags_doc, NULL },
{ (char*)"taint_flags", sr_py_koops_stacktrace_get_taint_flags, sr_py_koops_stacktrace_set_taint_flags, (char*)b_taint_flags_doc, NULL },
{ NULL },
};
@@ -125,6 +126,13 @@ sr_py_koops_stacktrace_set_modules(PyObject *self, PyObject *rhs, void *data)
}
PyObject *
+sr_py_koops_stacktrace_get_raw_oops(PyObject *self, void *data)
+{
+ struct sr_koops_stacktrace *st = ((struct sr_py_koops_stacktrace*)self)->stacktrace;
+ return Py_BuildValue("s", st->raw_oops);
+}
+
+PyObject *
sr_py_koops_stacktrace_get_taint_flags(PyObject *self, void *data)
{
struct sr_koops_stacktrace *st = ((struct sr_py_koops_stacktrace*)self)->stacktrace;
diff --git a/python/py_koops_stacktrace.h b/python/py_koops_stacktrace.h
index 162ac5e..af375f0 100644
--- a/python/py_koops_stacktrace.h
+++ b/python/py_koops_stacktrace.h
@@ -60,6 +60,7 @@ PyObject *sr_py_koops_stacktrace_str(PyObject *self);
/* getters & setters */
PyObject *sr_py_koops_stacktrace_get_modules(PyObject *self, void *data);
int sr_py_koops_stacktrace_set_modules(PyObject *self, PyObject *rhs, void *data);
+PyObject *sr_py_koops_stacktrace_get_raw_oops(PyObject *self, void *data);
PyObject *sr_py_koops_stacktrace_get_taint_flags(PyObject *self, void *data);
int sr_py_koops_stacktrace_set_taint_flags(PyObject *self, PyObject *rhs, void *data);
diff --git a/tests/koops_stacktrace.at b/tests/koops_stacktrace.at
index 6fae3a7..c6e5b20 100644
--- a/tests/koops_stacktrace.at
+++ b/tests/koops_stacktrace.at
@@ -280,7 +280,56 @@ main(void)
char *json = sr_koops_stacktrace_to_json(stacktrace);
puts(json);
assert(0 == strcmp(json,
- "{ \"taint_flags\": [ \"module_proprietary\"\n"
+ "{ \"raw_oops\": \"[110417.280426] WARNING: at mm/page_alloc.c:2204 __alloc_pages_nodemask+0x231/0x8f0()\\n"
+ "[110417.280429] Hardware name: Latitude E6420\\n"
+ "[110417.280431] Modules linked in: vfat fat usb_storage authenc l2tp_ppp pppox ppp_generic slhc l2tp_netlink "
+ "l2tp_core rmd160 crypto_null camellia lzo cast6 cast5 deflate zlib_deflate cts gcm ccm serpent_sse2_x86_64 "
+ "serpent_generic blowfish_generic blowfish_x86_64 blowfish_common twofish_generic twofish_x86_64_3way lrw "
+ "twofish_x86_64 twofish_common xcbc sha256_generic sha512_generic des_generic ah6 ah4 esp6 esp4 "
+ "xfrm4_mode_beet xfrm4_tunnel tunnel4 xfrm4_mode_tunnel xfrm4_mode_transport xfrm6_mode_transport "
+ "xfrm6_mode_ro xfrm6_mode_beet xfrm6_mode_tunnel ipcomp ipcomp6 xfrm_ipcomp xfrm6_tunnel tunnel6 af_key "
+ "snd_usb_audio snd_usbmidi_lib snd_rawmidi sctp libcrc32c tcp_lp wacom fuse lockd rfcomm bnep "
+ "snd_hda_codec_hdmi snd_hda_codec_idt binfmt_misc arc4 uvcvideo snd_hda_intel videobuf2_core videodev "
+ "snd_hda_codec ppdev media dell_wmi videobuf2_vmalloc sparse_keymap videobuf2_memops dell_laptop snd_hwdep "
+ "snd_seq uinput dcdbas snd_seq_device btusb bluetooth iwlwifi snd_pcm parport_pc \\n"
+ "joydev parport snd_timer microcode mac80211 snd soundcore snd_page_alloc i2c_i801 cfg80211 iTCO_wdt "
+ "iTCO_vendor_support rfkill e1000e sunrpc xts gf128mul dm_crypt sdhci_pci sdhci mmc_core wmi i915 "
+ "drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]\\n"
+ "[110417.280525] Pid: 3, comm: ksoftirqd/0 Tainted: P B D O 3.3.7-1.fc16.x86_64 #1\\n"
+ "[110417.280528] Call Trace:\\n"
+ "[110417.280535] [<ffffffff81057adf>] warn_slowpath_common+0x7f/0xc0\\n"
+ "[110417.280539] [<ffffffff81057b3a>] warn_slowpath_null+0x1a/0x20\\n"
+ "[110417.280544] [<ffffffff811296d1>] __alloc_pages_nodemask+0x231/0x8f0\\n"
+ "[110417.280550] [<ffffffff8151fd80>] ? ip_copy_metadata+0x1c0/0x1c0\\n"
+ "[110417.280555] [<ffffffff8151f860>] ? ip_forward_options+0x1f0/0x1f0\\n"
+ "[110417.280559] [<ffffffff81160a93>] alloc_pages_current+0xa3/0x110\\n"
+ "[110417.280563] [<ffffffff81125514>] __get_free_pages+0x14/0x50\\n"
+ "[110417.280569] [<ffffffff8116bb5f>] kmalloc_order_trace+0x3f/0xd0\\n"
+ "[110417.280573] [<ffffffff8116ca87>] __kmalloc+0x177/0x1a0\\n"
+ "[110417.280578] [<ffffffffa0642332>] ? pppol2tp_xmit+0x42/0x220 [l2tp_ppp]\\n"
+ "[110417.280583] [<ffffffff814db0a7>] pskb_expand_head+0x87/0x310\\n"
+ "[110417.280588] [<ffffffff8113dc59>] ? __mod_zone_page_state+0x49/0x50\\n"
+ "[110417.280591] [<ffffffff814da0f5>] ? kfree_skb+0x45/0xc0\\n"
+ "[110417.280595] [<ffffffffa06424dd>] pppol2tp_xmit+0x1ed/0x220 [l2tp_ppp]\\n"
+ "[110417.280600] [<ffffffffa062dd5b>] ppp_push+0x15b/0x650 [ppp_generic]\\n"
+ "[110417.280604] [<ffffffff814db264>] ? pskb_expand_head+0x244/0x310\\n"
+ "[110417.280608] [<ffffffff8112860b>] ? free_compound_page+0x1b/0x20\\n"
+ "[110417.280612] [<ffffffff8112d053>] ? __put_compound_page+0x23/0x30\\n"
+ "[110417.280615] [<ffffffff8112d1d5>] ? put_compound_page+0x125/0x1c0\\n"
+ "[110417.280619] [<ffffffffa062e89f>] ppp_xmit_process+0x46f/0x660 [ppp_generic]\\n"
+ "[110417.280624] [<ffffffffa062ebc8>] ppp_start_xmit+0x138/0x1d0 [ppp_generic]\\n"
+ "[110417.280628] [<ffffffff814e85b2>] dev_hard_start_xmit+0x332/0x6d0\\n"
+ "[110417.280632] [<ffffffff8150447a>] sch_direct_xmit+0xfa/0x1d0\\n"
+ "[110417.280635] [<ffffffff815045f6>] __qdisc_run+0xa6/0x130\\n"
+ "[110417.280639] [<ffffffff814e6883>] net_tx_action+0xe3/0x1f0\\n"
+ "[110417.280643] [<ffffffff8105f0c8>] __do_softirq+0xb8/0x230\\n"
+ "[110417.280646] [<ffffffff8105f2fa>] run_ksoftirqd+0xba/0x170\\n"
+ "[110417.280649] [<ffffffff8105f240>] ? __do_softirq+0x230/0x230\\n"
+ "[110417.280654] [<ffffffff81079da3>] kthread+0x93/0xa0\\n"
+ "[110417.280658] [<ffffffff815fd8e4>] kernel_thread_helper+0x4/0x10\\n"
+ "[110417.280663] [<ffffffff81079d10>] ? kthread_freezable_should_stop+0x70/0x70\\n"
+ "[110417.280666] [<ffffffff815fd8e0>] ? gs_change+0x13/0x13\\n\"\n"
+ ", \"taint_flags\": [ \"module_proprietary\"\n"
" , \"page_release\"\n"
" , \"died_recently\"\n"
" , \"module_out_of_tree\" ]\n"
--
1.8.3.1
10 years, 8 months
[ABRT PATCH] fix ccpp hook to create the type element - closes #682
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/hooks/abrt-hook-ccpp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
index a3f6923..aa66bb6 100644
--- a/src/hooks/abrt-hook-ccpp.c
+++ b/src/hooks/abrt-hook-ccpp.c
@@ -705,6 +705,7 @@ int main(int argc, char** argv)
free(dest_filename);
dd_save_text(dd, FILENAME_ANALYZER, "CCpp");
+ dd_save_text(dd, FILENAME_TYPE, "CCpp");
dd_save_text(dd, FILENAME_EXECUTABLE, executable);
dd_save_text(dd, FILENAME_PID, pid_str);
dd_save_text(dd, FILENAME_PROC_PID_STATUS, proc_pid_status);
--
1.8.3.1
10 years, 8 months
[SATYR PATCH 1/4] Refactor handling of warnings
by Martin Milata
Related to #94.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
lib/core_stacktrace.c | 10 +++-------
lib/core_unwind.c | 16 +---------------
lib/core_unwind_libunwind.c | 1 +
lib/gdb_frame.c | 9 +++------
lib/internal_unwind.h | 3 ---
lib/internal_utils.h | 4 ++++
lib/utils.c | 15 +++++++++++++++
7 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/lib/core_stacktrace.c b/lib/core_stacktrace.c
index 6534ce1..2b94d58 100644
--- a/lib/core_stacktrace.c
+++ b/lib/core_stacktrace.c
@@ -336,11 +336,8 @@ sr_core_stacktrace_create(const char *gdb_stacktrace_text,
if (!gdb_stacktrace)
{
- if (sr_debug_parser)
- {
- fprintf(stderr, "Unable to parse stacktrace: %d:%d: %s\n",
- location.line, location.column, location.message);
- }
+ warn("Unable to parse stacktrace: %d:%d: %s\n",
+ location.line, location.column, location.message);
return NULL;
}
@@ -349,8 +346,7 @@ sr_core_stacktrace_create(const char *gdb_stacktrace_text,
struct sr_unstrip_entry *unstrip = sr_unstrip_parse(unstrip_text);
if (!unstrip)
{
- if (sr_debug_parser)
- fprintf(stderr, "Unable to parse unstrip output.");
+ warn("Unable to parse unstrip output.");
return NULL;
}
diff --git a/lib/core_unwind.c b/lib/core_unwind.c
index 1268bfc..9597c75 100644
--- a/lib/core_unwind.c
+++ b/lib/core_unwind.c
@@ -29,6 +29,7 @@
#include "utils.h"
#include "core/unwind.h"
#include "internal_unwind.h"
+#include "internal_utils.h"
#include "location.h"
#include "gdb/frame.h"
@@ -69,21 +70,6 @@ _set_error(char **error_msg, const char *fmt, ...)
}
void
-warn(const char *fmt, ...)
-{
- va_list ap;
-
- if (!sr_debug_parser)
- return;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- va_end(ap);
-
-}
-
-void
core_handle_free(struct core_handle *ch)
{
if (ch)
diff --git a/lib/core_unwind_libunwind.c b/lib/core_unwind_libunwind.c
index 221e968..966a5b9 100644
--- a/lib/core_unwind_libunwind.c
+++ b/lib/core_unwind_libunwind.c
@@ -22,6 +22,7 @@
#include "core/thread.h"
#include "core/stacktrace.h"
#include "internal_unwind.h"
+#include "internal_utils.h"
#ifdef WITH_LIBUNWIND
diff --git a/lib/gdb_frame.c b/lib/gdb_frame.c
index 7cf0287..57e9479 100644
--- a/lib/gdb_frame.c
+++ b/lib/gdb_frame.c
@@ -338,12 +338,9 @@ sr_gdb_frame_parse(const char **input,
++local_input;
}
- if (sr_debug_parser)
- {
- printf("frame #%u %s\n",
- header->number,
- header->function_name ? header->function_name : "signal handler called");
- }
+ warn("frame #%u %s\n",
+ header->number,
+ header->function_name ? header->function_name : "signal handler called");
*input = local_input;
return header;
diff --git a/lib/internal_unwind.h b/lib/internal_unwind.h
index 3aa2b63..d537f86 100644
--- a/lib/internal_unwind.h
+++ b/lib/internal_unwind.h
@@ -52,9 +52,6 @@
void
_set_error(char **error_msg, const char *fmt, ...) __sr_printf(2, 3);
-void
-warn(const char *fmt, ...) __sr_printf(1, 2);
-
/* internal linked list manipulation */
#define list_append(head,tail,item) \
do{ \
diff --git a/lib/internal_utils.h b/lib/internal_utils.h
index faa42be..e69fb97 100644
--- a/lib/internal_utils.h
+++ b/lib/internal_utils.h
@@ -20,9 +20,13 @@
#ifndef SATYR_INTERNAL_UTILS_H
#define SATYR_INTERNAL_UTILS_H
+#include "utils.h"
#include <stddef.h>
#include <assert.h>
+void
+warn(const char *fmt, ...) __sr_printf(1, 2);
+
#define DISPATCH(table, type, method) \
(assert((type > SR_REPORT_INVALID) && (type) < SR_REPORT_NUM && table[type]->method), \
table[type]->method)
diff --git a/lib/utils.c b/lib/utils.c
index ac56c7e..206c1fa 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -37,6 +37,21 @@ sr_debug_parser = false;
static const char
hexdigits_locase[] = "0123456789abcdef";
+void
+warn(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (!sr_debug_parser)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+
+}
+
void *
sr_malloc(size_t size)
{
--
1.8.3.1
10 years, 8 months