Blame src/plugins/ccpp_event.conf

Packit 8ea169
EVENT=post-create type=CCpp remote!=1
Packit 8ea169
        if grep '^TracerPid:[[:space:]]*[123456789]' proc_pid_status >/dev/null 2>&1; then
Packit 8ea169
            # We see 'TracerPid: <nonzero>" in /proc/PID/status
Packit 8ea169
            # Process is ptraced (gdb, strace, ltrace)
Packit 8ea169
            # Debuggers have wide variety of bugs where they leak SIGTRAP
Packit 8ea169
            # to traced process and nuke it. Ignore this crash.
Packit 8ea169
            echo "The crashed process was ptraced - not saving the crash"
Packit 8ea169
            exit 1  # abrt will remove the problem directory
Packit 8ea169
        fi
Packit 8ea169
        if grep -q ^ABRT_IGNORE_ALL=1 environ \
Packit 8ea169
        || grep -q ^ABRT_IGNORE_CCPP=1 environ \
Packit 8ea169
        ; then
Packit 8ea169
            echo "ABRT_IGNORE variable is 1 - not saving the crash"
Packit 8ea169
            # abrtd will delete the problem directory when we exit nonzero:
Packit 8ea169
            exit 1
Packit 8ea169
        fi
Packit 8ea169
        # Try generating backtrace, if it fails we can still use
Packit 8ea169
        # the hash generated by abrt-action-analyze-c
Packit 8ea169
        [ ! -e core_backtrace ] && abrt-action-generate-core-backtrace
Packit 8ea169
        # Run GDB plugin to see if crash looks exploitable
Packit 8ea169
        [ -r coredump ] && abrt-action-analyze-vulnerability
Packit 8ea169
        # Generate hash
Packit 8ea169
        abrt-action-analyze-c &&
Packit 8ea169
        abrt-action-list-dsos -m maps -o dso_list &&
Packit 8ea169
        (
Packit 8ea169
            # Try to save relevant log lines.
Packit 8ea169
            # Can't do it as analyzer step, non-root can't read log.
Packit 8ea169
            executable=`cat executable` &&
Packit 8ea169
            base_executable=${executable##*/} &&
Packit 8ea169
            uid=`cat $DUMP_DIR/uid` &&
Packit 8ea169
            {
Packit 8ea169
                user_log_full=`journalctl -q -b --since=-3m -n 99 _COMM="$base_executable" _UID="$uid"` &&
Packit 8ea169
                while read line; do
Packit 8ea169
                    if [[ $line != *" audit["* ]]; then
Packit 8ea169
                        user_log=$user_log$line$'\n'
Packit 8ea169
                    fi
Packit 8ea169
                done <<< "$user_log_full"
Packit 8ea169
                test -n "${user_log::-1}" && printf "User Logs:\n--%s--\n" "$user_log" >$DUMP_DIR/var_log_messages
Packit 8ea169
                # Do not use '&&' here because if $user_log is the empty string
Packit 8ea169
                # then the script does not continue to get the system logs
Packit 8ea169
                {
Packit 8ea169
                    # Remove the line below if you don't mind sharing data from the
Packit 8ea169
                    # system logs with unprivileged users -> bugzilla.redhat.com/1212868
Packit 8ea169
                    false &&
Packit 8ea169
                    system_log_full=$log`journalctl -q -b --since=-3m --system -n 99 _COMM="$base_executable"` &&
Packit 8ea169
                    while read line; do
Packit 8ea169
                        if [[ $line != *" audit["* ]]; then
Packit 8ea169
                            system_log=$system_log$line$'\n'
Packit 8ea169
                        fi
Packit 8ea169
                    done <<< "$system_log_full"
Packit 8ea169
                    test -n "${system_log::-1}" && printf "System Logs:\n--%s--\n" "$system_log" >$DUMP_DIR/var_log_messages
Packit 8ea169
                    # Always exit with true here, because the false at
Packit 8ea169
                    # the beginning would cause the post-create hook to remove
Packit 8ea169
                    # the current problem directory.
Packit 8ea169
                    true
Packit 8ea169
                }
Packit 8ea169
            }
Packit 8ea169
        )
Packit 8ea169
Packit 8ea169
EVENT=collect_xsession_errors type=CCpp dso_list~=.*/libX11.*
Packit 8ea169
        #
Packit 8ea169
        # Where is X session error log - traditional or new location?
Packit 8ea169
        #
Packit 8ea169
        xsession_errors=~/.xsession-errors
Packit 8ea169
        test -f "$xsession_errors" || xsession_errors=~/.cache/gdm/session.log
Packit 8ea169
        #
Packit 8ea169
        # We do not want to abort further processing,
Packit 8ea169
        # thus we do not fail (exit with nonzero) if the file isn't there:
Packit 8ea169
        test -f "$xsession_errors" || { echo "No $xsession_errors"; exit 0; }
Packit 8ea169
        test -r "$xsession_errors" || { echo "Can't read $xsession_errors"; exit 0; }
Packit 8ea169
        executable=`cat executable` &&
Packit 8ea169
        base_executable=${executable##*/} &&
Packit 8ea169
        grep -F -e "$base_executable" "$xsession_errors" | tail -999 >xsession_errors &&
Packit 8ea169
        echo "Element 'xsession_errors' saved"
Packit 8ea169
Packit 8ea169
# TODO: can we still specify additional directories to search for debuginfos,
Packit 8ea169
# or was this ability lost with move to python installer?
Packit 8ea169
EVENT=analyze_LocalGDB type=CCpp
Packit 8ea169
        abrt-action-analyze-ccpp-local
Packit 8ea169
Packit 8ea169
Packit 8ea169
# Bugzilla requires nonempty duphash
Packit 8ea169
EVENT=report_Bugzilla type=CCpp duphash!=
Packit 8ea169
        test -f component || abrt-action-save-package-data
Packit 8ea169
        component="`cat component`"
Packit 8ea169
        format="bugzilla_format.conf"
Packit 8ea169
        test -f "/etc/libreport/plugins/bugzilla_format_$component.conf" \
Packit 8ea169
                && format="bugzilla_format_$component.conf"
Packit 8ea169
        formatdup="bugzilla_formatdup.conf"
Packit 8ea169
        test -f "/etc/libreport/plugins/bugzilla_formatdup_$component.conf" \
Packit 8ea169
                && formatdup="bugzilla_formatdup_$component.conf"
Packit 8ea169
        reporter-bugzilla -b \
Packit 8ea169
                -c /etc/libreport/plugins/bugzilla.conf \
Packit 8ea169
                -F "/etc/libreport/plugins/$format" \
Packit 8ea169
                -A "/etc/libreport/plugins/$formatdup"
Packit 8ea169
Packit 8ea169
# Send micro report
Packit 8ea169
EVENT=report_uReport type=CCpp
Packit 8ea169
        /usr/libexec/abrt-action-ureport
Packit 8ea169
Packit 8ea169
# update ABRT database after successful report to bugzilla
Packit 8ea169
EVENT=post_report type=CCpp
Packit 8ea169
        reporter-ureport -A -B
Packit 8ea169
Packit 8ea169
EVENT=analyze_CCpp type=CCpp
Packit 8ea169
        abrt-action-perform-ccpp-analysis
Packit 8ea169
Packit 8ea169
# Reporting of C/Cpp problems
Packit 8ea169
EVENT=report-gui type=CCpp
Packit 8ea169
        report-gtk -- "$DUMP_DIR"
Packit 8ea169
Packit 8ea169
EVENT=report-cli type=CCpp
Packit 8ea169
        report-cli -- "$DUMP_DIR"
Packit 8ea169
Packit 8ea169
EVENT=report_systemd-journal type=CCpp analyzer=abrt-ccpp
Packit 8ea169
        reporter-systemd-journal --message-id 5ab0271ecf1941a2b89299716e880661 \
Packit 8ea169
                                 -F /etc/libreport/plugins/catalog_ccpp_format.conf
Packit 8ea169
Packit 8ea169
EVENT=report_systemd-journal type=CCpp analyzer=abrt-journal-core
Packit 8ea169
        reporter-systemd-journal --message-id 5ab0271ecf1941a2b89299716e880661 \
Packit 8ea169
                                 -F /etc/libreport/plugins/catalog_journal_ccpp_format.conf