diff --git a/0001-Use-lazy-imports-in-abrt_exception_handler3.patch b/0001-Use-lazy-imports-in-abrt_exception_handler3.patch new file mode 100644 index 0000000..5c892a8 --- /dev/null +++ b/0001-Use-lazy-imports-in-abrt_exception_handler3.patch @@ -0,0 +1,57 @@ +From 4755f2171aa50a72d8ec03260c8cbc602263a6c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 24 Sep 2021 17:48:07 +0200 +Subject: [PATCH] Use lazy imports in abrt_exception_handler3 + +The abrt_exception_handler3 module is always imported when Python starts, +but all the modules imported from it (except sys) are only used during crashes. + +Especially the systemd.journal import is really expensive. + +Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2007664 +--- + src/hooks/abrt_exception_handler3.py.in | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/hooks/abrt_exception_handler3.py.in b/src/hooks/abrt_exception_handler3.py.in +index 89e2474b..0bc548e0 100644 +--- a/src/hooks/abrt_exception_handler3.py.in ++++ b/src/hooks/abrt_exception_handler3.py.in +@@ -20,13 +20,15 @@ + Module for the ABRT exception handling hook + """ + ++# Avoid importing anything but sys here, use lazy imports. ++# This file is imported on every Python startup, ++# all unused imports only increase the startup time and memory usage. + import sys +-import os + +-from systemd import journal + + def syslog(msg): + """Log message to system logger (journal)""" ++ from systemd import journal + + journal.send(msg) + +@@ -68,6 +70,8 @@ def send(data): + + + def write_dump(tb_text, tb): ++ import os ++ + if sys.argv[0][0] == "/": + executable = os.path.abspath(sys.argv[0]) + else: +@@ -118,6 +122,7 @@ def handle_exception(etype, value, tb): + sys.excepthook = sys.__excepthook__ # pylint: disable-msg=E1101 + + import errno ++ import os + + # Ignore Ctrl-C + # SystemExit rhbz#636913 -> this exception is not an error +-- +2.31.1 + diff --git a/Decommission-libreport_list_free_with_free.patch b/Decommission-libreport_list_free_with_free.patch deleted file mode 100644 index 43d2849..0000000 --- a/Decommission-libreport_list_free_with_free.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 94dc256644a82f2777cd1193cc0d1d3b5e8be10a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= -Date: Thu, 13 Aug 2020 11:49:28 +0200 -Subject: [PATCH] Decommission libreport_list_free_with_free - -Follow-up to abrt/libreport#660 ---- - src/daemon/rpm.c | 5 ++--- - src/dbus/abrt-dbus.c | 16 ++++++++-------- - src/lib/kernel.c | 3 +-- - src/plugins/abrt-action-trim-files.c | 2 +- - src/plugins/abrt-dump-oops.c | 3 +-- - 5 files changed, 13 insertions(+), 16 deletions(-) - -diff --git a/src/daemon/rpm.c b/src/daemon/rpm.c -index 9bbdaa516..af9ff63a1 100644 ---- a/src/daemon/rpm.c -+++ b/src/daemon/rpm.c -@@ -63,7 +63,7 @@ void rpm_init() - error_msg("Can't read RPM rc files"); - #endif - -- libreport_list_free_with_free(list_fingerprints); /* paranoia */ -+ g_list_free_full(list_fingerprints, free); - /* Huh? Why do we start the list with an element with NULL string? */ - list_fingerprints = g_list_alloc(); - } -@@ -77,8 +77,7 @@ void rpm_destroy() - #endif - #endif - -- libreport_list_free_with_free(list_fingerprints); -- list_fingerprints = NULL; -+ g_list_free_full(g_steal_pointer(&list_fingerprints), free); - } - - void rpm_load_gpgkey(const char* filename) -diff --git a/src/dbus/abrt-dbus.c b/src/dbus/abrt-dbus.c -index dc7ad75c2..0c5fd3308 100644 ---- a/src/dbus/abrt-dbus.c -+++ b/src/dbus/abrt-dbus.c -@@ -390,7 +390,7 @@ static void handle_method_call(GDBusConnection *connection, - { - GList *dirs = get_problem_dirs_for_uid(caller_uid, abrt_g_settings_dump_location); - response = variant_from_string_list(dirs); -- libreport_list_free_with_free(dirs); -+ g_list_free_full(dirs, free); - - g_dbus_method_invocation_return_value(invocation, response); - //I was told that g_dbus_method frees the response -@@ -411,10 +411,10 @@ static void handle_method_call(GDBusConnection *connection, - caller_uid = 0; - } - -- GList * dirs = get_problem_dirs_for_uid(caller_uid, abrt_g_settings_dump_location); -+ GList *dirs = get_problem_dirs_for_uid(caller_uid, abrt_g_settings_dump_location); - response = variant_from_string_list(dirs); - -- libreport_list_free_with_free(dirs); -+ g_list_free_full(dirs, free); - - g_dbus_method_invocation_return_value(invocation, response); - return; -@@ -422,9 +422,9 @@ static void handle_method_call(GDBusConnection *connection, - - if (g_strcmp0(method_name, "GetForeignProblems") == 0) - { -- GList * dirs = get_problem_dirs_not_accessible_by_uid(caller_uid, abrt_g_settings_dump_location); -+ GList *dirs = get_problem_dirs_not_accessible_by_uid(caller_uid, abrt_g_settings_dump_location); - response = variant_from_string_list(dirs); -- libreport_list_free_with_free(dirs); -+ g_list_free_full(dirs, free); - - g_dbus_method_invocation_return_value(invocation, response); - return; -@@ -540,7 +540,7 @@ static void handle_method_call(GDBusConnection *connection, - g_variant_builder_add(builder, "{ss}", element_name, value); - } - } -- libreport_list_free_with_free(elements); -+ g_list_free_full(elements, free); - dd_close(dd); - /* It is OK to call g_variant_new("(a{ss})", NULL) because */ - /* G_VARIANT_TYPE_TUPLE allows NULL value */ -@@ -749,7 +749,7 @@ static void handle_method_call(GDBusConnection *connection, - - g_dbus_method_invocation_return_value(invocation, NULL); - ret: -- libreport_list_free_with_free(problem_dirs); -+ g_list_free_full(problem_dirs, free); - return; - } - -@@ -776,7 +776,7 @@ static void handle_method_call(GDBusConnection *connection, - GList *dirs = get_problem_dirs_for_element_in_time(caller_uid, element, value, timestamp_from, - timestamp_to); - response = variant_from_string_list(dirs); -- libreport_list_free_with_free(dirs); -+ g_list_free_full(dirs, free); - - g_dbus_method_invocation_return_value(invocation, response); - return; -diff --git a/src/lib/kernel.c b/src/lib/kernel.c -index 758fe63dd..7c266a249 100644 ---- a/src/lib/kernel.c -+++ b/src/lib/kernel.c -@@ -357,8 +357,7 @@ void abrt_koops_extract_oopses(GList **oops_list, char *buffer, size_t buflen) - free(lines_info); - lines_info = NULL; - lines_info_size = 0; -- libreport_list_free_with_free(*oops_list); -- *oops_list = NULL; -+ g_list_free_full(g_steal_pointer(oops_list), free); - } - goto next_line; - } -diff --git a/src/plugins/abrt-action-trim-files.c b/src/plugins/abrt-action-trim-files.c -index 4633a8d9a..5ab953dfe 100644 ---- a/src/plugins/abrt-action-trim-files.c -+++ b/src/plugins/abrt-action-trim-files.c -@@ -179,7 +179,7 @@ static void delete_files(gpointer data, gpointer void_preserve_list) - - if (cur_size <= cap_size || !worst_file_list) - { -- libreport_list_free_with_free(worst_file_list); -+ g_list_free_full(g_steal_pointer(&worst_file_list), free); - log_info("cur_size:%.0f cap_size:%.0f, no (more) trimming", cur_size, cap_size); - break; - } -diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c -index f30b87bb6..0781b910c 100644 ---- a/src/plugins/abrt-dump-oops.c -+++ b/src/plugins/abrt-dump-oops.c -@@ -196,8 +196,7 @@ int main(int argc, char **argv) - errors = abrt_oops_process_list(oops_list, dump_location, - ABRT_DUMP_OOPS_ANALYZER, oops_utils_flags); - -- libreport_list_free_with_free(oops_list); -- //oops_list = NULL; -+ g_list_free_full(oops_list, free); - - return errors; - } diff --git a/abrt-2.14.3.tar.gz b/abrt-2.14.3.tar.gz deleted file mode 100644 index 6c85efc..0000000 Binary files a/abrt-2.14.3.tar.gz and /dev/null differ diff --git a/abrt-2.14.6.tar.gz b/abrt-2.14.6.tar.gz new file mode 100644 index 0000000..7840208 Binary files /dev/null and b/abrt-2.14.6.tar.gz differ diff --git a/abrt.spec b/abrt.spec index 4080e44..fedb286 100644 --- a/abrt.spec +++ b/abrt.spec @@ -1,12 +1,12 @@ Name: abrt -Version: 2.14.3 +Version: 2.14.6 Release: 1 Summary: A tool for automatic bug detection and reporting License: GPL-2.0 and GPL-2.0+ URL: https://github.com/abrt/abrt/ Source: https://github.com/abrt/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: Decommission-libreport_list_free_with_free.patch +Patch0: 0001-Use-lazy-imports-in-abrt_exception_handler3.patch BuildRequires: git-core dbus-devel hostname gtk3-devel glib2-devel >= 2.43.4 rpm-devel >= 4.6 BuildRequires: desktop-file-utils libnotify-devel gettext libxml2-devel intltool libtool @@ -22,6 +22,7 @@ Requires: systemd python3-%{name} = %{version}-%{release} python3-augeas py Requires: dmidecode Requires: %{name}-libs = %{version}-%{release} +Obsoletes: abrt-plugin-sosreport < 2.14.5 Requires(pre): shadow-utils %{?systemd_requires} @@ -115,7 +116,7 @@ from Xorg log. %package addon-vmcore Summary: Vmcore addon module for abrt Requires: %{name} = %{version}-%{release} abrt-addon-kerneloops kexec-tools -Requires: python3-abrt python3-augeas util-linux +Requires: python3-abrt python3-augeas util-linux python3-systemd %description addon-vmcore This package provides plugin which helps to collect kernel crash information @@ -148,14 +149,6 @@ Requires: container-exception-logger This package provides python3 hook and handling uncaught exception in python3 container's programs. -%package plugin-sosreport -Summary: Plugin for building automatic sosreports for abrt -Requires: sos >= 3.6 %{name} = %{version}-%{release} - -%description plugin-sosreport -This package provides a configuration snippet for abrt events which used to enable -automatic generation of sosreports. - %package plugin-machine-id Summary: Plugin to generate machine_id based off dmidecode for abrt Requires: %{name} = %{version}-%{release} @@ -561,9 +554,6 @@ killall abrt-dbus >/dev/null 2>&1 || : %{python3_sitelib}/abrt_exception_handler3_container.py %{python3_sitelib}/__pycache__/abrt_exception_handler3_container.* -%files plugin-sosreport -%config(noreplace) %{_sysconfdir}/libreport/events.d/sosreport_event.conf - %files plugin-machine-id %config(noreplace) %{_sysconfdir}/libreport/events.d/machine-id_event.conf %{_libexecdir}/abrt-action-generate-machine-id @@ -605,6 +595,9 @@ killall abrt-dbus >/dev/null 2>&1 || : %{_mandir}/man*/* %changelog +* Thu Jan 13 2022 liyanan - 2.14.6-1 +- Update to 2.14.6 + * Sat Jan 08 2022 huanghaitao - 2.14.3-1 - Update to 2.14.3