192 |
- |
1 |
EVENT=post-create type=CCpp remote!=1
|
|
|
2 |
if grep '^TracerPid:[[:space:]]*[123456789]' proc_pid_status >/dev/null 2>&1; then
|
|
|
3 |
# We see 'TracerPid: <nonzero>" in /proc/PID/status
|
|
|
4 |
# Process is ptraced (gdb, strace, ltrace)
|
|
|
5 |
# Debuggers have wide variety of bugs where they leak SIGTRAP
|
|
|
6 |
# to traced process and nuke it. Ignore this crash.
|
|
|
7 |
echo "The crashed process was ptraced - not saving the crash"
|
|
|
8 |
exit 1 # abrt will remove the problem directory
|
|
|
9 |
fi
|
|
|
10 |
if grep -q ^ABRT_IGNORE_ALL=1 environ \
|
|
|
11 |
|| grep -q ^ABRT_IGNORE_CCPP=1 environ \
|
|
|
12 |
; then
|
|
|
13 |
echo "ABRT_IGNORE variable is 1 - not saving the crash"
|
|
|
14 |
# abrtd will delete the problem directory when we exit nonzero:
|
|
|
15 |
exit 1
|
|
|
16 |
fi
|
|
|
17 |
# Try generating backtrace, if it fails we can still use
|
|
|
18 |
# the hash generated by abrt-action-analyze-c
|
|
|
19 |
[ ! -e core_backtrace ] && abrt-action-generate-core-backtrace
|
|
|
20 |
# Run GDB plugin to see if crash looks exploitable
|
|
|
21 |
[ -r coredump ] && abrt-action-analyze-vulnerability
|
|
|
22 |
# Generate hash
|
|
|
23 |
abrt-action-analyze-c &&
|
|
|
24 |
abrt-action-list-dsos -m maps -o dso_list &&
|
|
|
25 |
(
|
|
|
26 |
# Try to save relevant log lines.
|
|
|
27 |
# Can't do it as analyzer step, non-root can't read log.
|
|
|
28 |
executable=`cat executable` &&
|
|
|
29 |
base_executable=${executable##*/} &&
|
|
|
30 |
uid=`cat $DUMP_DIR/uid` &&
|
|
|
31 |
{
|
|
|
32 |
user_log_full=`journalctl -q -b --since=-3m -n 99 _COMM="$base_executable" _UID="$uid"` &&
|
|
|
33 |
while read line; do
|
|
|
34 |
if [[ $line != *" audit["* ]]; then
|
|
|
35 |
user_log=$user_log$line$'\n'
|
|
|
36 |
fi
|
|
|
37 |
done <<< "$user_log_full"
|
|
|
38 |
test -n "${user_log::-1}" && printf "User Logs:\n--%s--\n" "$user_log" >$DUMP_DIR/var_log_messages
|
|
|
39 |
# Do not use '&&' here because if $user_log is the empty string
|
|
|
40 |
# then the script does not continue to get the system logs
|
|
|
41 |
{
|
|
|
42 |
# Remove the line below if you don't mind sharing data from the
|
|
|
43 |
# system logs with unprivileged users -> bugzilla.redhat.com/1212868
|
|
|
44 |
false &&
|
|
|
45 |
system_log_full=$log`journalctl -q -b --since=-3m --system -n 99 _COMM="$base_executable"` &&
|
|
|
46 |
while read line; do
|
|
|
47 |
if [[ $line != *" audit["* ]]; then
|
|
|
48 |
system_log=$system_log$line$'\n'
|
|
|
49 |
fi
|
|
|
50 |
done <<< "$system_log_full"
|
|
|
51 |
test -n "${system_log::-1}" && printf "System Logs:\n--%s--\n" "$system_log" >$DUMP_DIR/var_log_messages
|
|
|
52 |
# Always exit with true here, because the false at
|
|
|
53 |
# the beginning would cause the post-create hook to remove
|
|
|
54 |
# the current problem directory.
|
|
|
55 |
true
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
)
|
|
|
59 |
|
|
|
60 |
EVENT=collect_xsession_errors type=CCpp dso_list~=.*/libX11.*
|
|
|
61 |
#
|
|
|
62 |
# Where is X session error log - traditional or new location?
|
|
|
63 |
#
|
|
|
64 |
xsession_errors=~/.xsession-errors
|
|
|
65 |
test -f "$xsession_errors" || xsession_errors=~/.cache/gdm/session.log
|
|
|
66 |
#
|
|
|
67 |
# We do not want to abort further processing,
|
|
|
68 |
# thus we do not fail (exit with nonzero) if the file isn't there:
|
|
|
69 |
test -f "$xsession_errors" || { echo "No $xsession_errors"; exit 0; }
|
|
|
70 |
test -r "$xsession_errors" || { echo "Can't read $xsession_errors"; exit 0; }
|
|
|
71 |
executable=`cat executable` &&
|
|
|
72 |
base_executable=${executable##*/} &&
|
|
|
73 |
grep -F -e "$base_executable" "$xsession_errors" | tail -999 >xsession_errors &&
|
|
|
74 |
echo "Element 'xsession_errors' saved"
|
|
|
75 |
|
|
|
76 |
# TODO: can we still specify additional directories to search for debuginfos,
|
|
|
77 |
# or was this ability lost with move to python installer?
|
|
|
78 |
EVENT=analyze_LocalGDB type=CCpp
|
|
|
79 |
abrt-action-analyze-ccpp-local
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
# Bugzilla requires nonempty duphash
|
|
|
83 |
EVENT=report_Bugzilla type=CCpp duphash!=
|
|
|
84 |
test -f component || abrt-action-save-package-data
|
|
|
85 |
component="`cat component`"
|
|
|
86 |
format="bugzilla_format.conf"
|
|
|
87 |
test -f "/etc/libreport/plugins/bugzilla_format_$component.conf" \
|
|
|
88 |
&& format="bugzilla_format_$component.conf"
|
|
|
89 |
formatdup="bugzilla_formatdup.conf"
|
|
|
90 |
test -f "/etc/libreport/plugins/bugzilla_formatdup_$component.conf" \
|
|
|
91 |
&& formatdup="bugzilla_formatdup_$component.conf"
|
|
|
92 |
reporter-bugzilla -b \
|
|
|
93 |
-c /etc/libreport/plugins/bugzilla.conf \
|
|
|
94 |
-F "/etc/libreport/plugins/$format" \
|
|
|
95 |
-A "/etc/libreport/plugins/$formatdup"
|
|
|
96 |
|
|
|
97 |
# Send micro report
|
|
|
98 |
EVENT=report_uReport type=CCpp
|
|
|
99 |
/usr/libexec/abrt-action-ureport
|
|
|
100 |
|
|
|
101 |
# update ABRT database after successful report to bugzilla
|
|
|
102 |
EVENT=post_report type=CCpp
|
|
|
103 |
reporter-ureport -A -B
|
|
|
104 |
|
|
|
105 |
EVENT=analyze_CCpp type=CCpp
|
|
|
106 |
abrt-action-perform-ccpp-analysis
|
|
|
107 |
|
|
|
108 |
# Reporting of C/Cpp problems
|
|
|
109 |
EVENT=report-gui type=CCpp
|
|
|
110 |
report-gtk -- "$DUMP_DIR"
|
|
|
111 |
|
|
|
112 |
EVENT=report-cli type=CCpp
|
|
|
113 |
report-cli -- "$DUMP_DIR"
|