From 36fd7e27345109563fa2374031061d5a10b7e130 Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Aug 14 2015 13:11:48 +0000 Subject: Fix bugs in a-auto-reporting, dbus, a-hook-ccpp, abrt-cli and pstoreoops Signed-off-by: Matej Habrnal --- diff --git a/0009-abrt-merge-pstoreoops-merge-files-in-descending-orde.patch b/0009-abrt-merge-pstoreoops-merge-files-in-descending-orde.patch new file mode 100644 index 0000000..0920b06 --- /dev/null +++ b/0009-abrt-merge-pstoreoops-merge-files-in-descending-orde.patch @@ -0,0 +1,35 @@ +From 5349718f775c39124e789457d2c012ac23c81619 Mon Sep 17 00:00:00 2001 +From: "knoha@redhat.com" +Date: Fri, 24 Jul 2015 07:56:02 +0200 +Subject: [PATCH] abrt-merge-pstoreoops: merge files in descending order + +fs/pstore reads the data from kmsg_dump_get_buffer(), which starts at +the end of the kmsg buffer, in a while loop and increases Part no. in +each iteration. + +Related: rhbz#1233662 + +Signed-off-by: Jakub Filak +--- + src/hooks/abrt-merge-pstoreoops.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/hooks/abrt-merge-pstoreoops.c b/src/hooks/abrt-merge-pstoreoops.c +index 6fc3109..36f1e0b 100644 +--- a/src/hooks/abrt-merge-pstoreoops.c ++++ b/src/hooks/abrt-merge-pstoreoops.c +@@ -64,9 +64,9 @@ int compare_oops_texts(const void *a, const void *b) + return -1; + if (aa->panic_no > bb->panic_no) + return 1; +- if (aa->part_no < bb->part_no) ++ if (aa->part_no > bb->part_no) + return -1; +- return (aa->part_no > bb->part_no); ++ return (aa->part_no < bb->part_no); + } + + int main(int argc, char **argv) +-- +2.4.3 + diff --git a/0010-abrt-auto-reporting-fix-related-to-conditional-compi.patch b/0010-abrt-auto-reporting-fix-related-to-conditional-compi.patch new file mode 100644 index 0000000..ea1aa95 --- /dev/null +++ b/0010-abrt-auto-reporting-fix-related-to-conditional-compi.patch @@ -0,0 +1,33 @@ +From 03be49244ab5f4fdd7521254dd6afedbd277ceea Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Tue, 28 Jul 2015 13:17:25 +0200 +Subject: [PATCH] abrt-auto-reporting: fix related to conditional compilation + +We discovered that conditional compilation in abrt-auto-reporting does not +work. We forgot add -DAUTHENTICATED_AUTOREPORTING=1 flag if +AUTHENTICATED_AUTOREPORTING is enabled. + +Related to rhbz#1191572 +--- + src/daemon/Makefile.am | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am +index a8f3fa2..563923a 100644 +--- a/src/daemon/Makefile.am ++++ b/src/daemon/Makefile.am +@@ -122,6 +122,11 @@ abrt_auto_reporting_CPPFLAGS = \ + -I$(srcdir)/../lib \ + $(LIBREPORT_CFLAGS) \ + -D_GNU_SOURCE ++ ++if AUTHENTICATED_AUTOREPORTING ++abrt_auto_reporting_CPPFLAGS += -DAUTHENTICATED_AUTOREPORTING=1 ++endif ++ + abrt_auto_reporting_LDADD = \ + ../lib/libabrt.la \ + $(LIBREPORT_LIBS) +-- +2.4.3 + diff --git a/0011-doc-fix-related-to-conditional-compilation-of-man-pa.patch b/0011-doc-fix-related-to-conditional-compilation-of-man-pa.patch new file mode 100644 index 0000000..59ed02c --- /dev/null +++ b/0011-doc-fix-related-to-conditional-compilation-of-man-pa.patch @@ -0,0 +1,44 @@ +From f1e5d631932a05e3147b6af73ce1230150f9f979 Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Tue, 28 Jul 2015 16:20:47 +0200 +Subject: [PATCH] doc: fix related to conditional compilation of man page + +abrt-auto-reporting.txt is a copy of either +abrt-auto-reporting-authenticated.txt or +abrt-auto-reporting-unauthenticated.txt. abrt-auto-reporting.txt file always +exists because MAN1_TXT variable contains it and is distributed (the file is listed +in the EXTRA_DIST variable). It would be difficult to ensure +to have abrt-auto-reporting.txt in the MAN1_TXT and exclude it +from the EXTRA_DIST. So enforce copy, to get the right version of man page, seems +like the easiest way. + +Related to rhbz#1191572 + +Signed-off-by: Matej Habrnal +--- + doc/Makefile.am | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index f39c3bf..fdd08cf 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -82,6 +82,15 @@ MAN_SOURCE = + MAN_SOURCE += abrt-auto-reporting-authenticated.txt + MAN_SOURCE += abrt-auto-reporting-unauthenticated.txt + ++# abrt-auto-reporting.txt is a copy of either ++# abrt-auto-reporting-authenticated.txt or ++# abrt-auto-reporting-unauthenticated.txt. abrt-auto-reporting.txt file always ++# exists because MAN1_TXT variable contains it and is distributed (the file is listed ++# in the EXTRA_DIST variable). It would be difficult to ensure ++# to have abrt-auto-reporting.txt in the MAN1_TXT and exclude it ++# from the EXTRA_DIST. So enforce copy, to get the right version of man page, seems ++# like the easiest way. ++.PHONY: abrt-auto-reporting.txt + if AUTHENTICATED_AUTOREPORTING + abrt-auto-reporting.txt: abrt-auto-reporting-authenticated.txt + else +-- +2.4.3 + diff --git a/0012-dbus-api-unify-reporting-of-errors.patch b/0012-dbus-api-unify-reporting-of-errors.patch new file mode 100644 index 0000000..59568ab --- /dev/null +++ b/0012-dbus-api-unify-reporting-of-errors.patch @@ -0,0 +1,99 @@ +From 0c3a29b70992627481af789dab50247728bcedf1 Mon Sep 17 00:00:00 2001 +From: Jakub Filak +Date: Tue, 11 Aug 2015 09:54:55 +0200 +Subject: [PATCH] dbus-api: unify reporting of errors + +User ERR_PTR for failures in all functions because some of the functions +use NULL as a valid response (NULL is an empty GList). + +Related: rhbz#1224984 + +Signed-off-by: Jakub Filak +--- + src/include/libabrt.h | 16 +++++++++------- + src/lib/problem_api_dbus.c | 2 +- + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/src/include/libabrt.h b/src/include/libabrt.h +index 4e73a0d..da565f9 100644 +--- a/src/include/libabrt.h ++++ b/src/include/libabrt.h +@@ -163,7 +163,7 @@ void koops_print_suspicious_strings_filtered(const regex_t **filterout); + + Requires authorization + +- @return 0 if successfull non-zeru on failure ++ @return 0 if successful; non-zero on failure + */ + int chown_dir_over_dbus(const char *problem_dir_path); + +@@ -181,7 +181,7 @@ int test_exist_over_dbus(const char *problem_id, const char *element_name); + + Might require authorization + +- @return Positive number if such the proble is complete, 0 if doesn't and negative number if an error occurs. ++ @return Positive number if the problem is complete, 0 if doesn't and negative number if an error occurs. + */ + int dbus_problem_is_complete(const char *problem_id); + +@@ -198,7 +198,8 @@ char *load_text_over_dbus(const char *problem_id, const char *element_name); + @brief Delets multiple problems specified by their id (as returned from problem_data_save) + + @param problem_dir_paths List of problem ids +- @return 0 if operation was successfull, non-zero on failure ++ ++ @return 0 if operation was successful, non-zero on failure + */ + + int delete_problem_dirs_over_dbus(const GList *problem_dir_paths); +@@ -206,21 +207,21 @@ int delete_problem_dirs_over_dbus(const GList *problem_dir_paths); + /** + @brief Fetches given problem elements for specified problem id + +- @return on failures returns non zero value and emits error message ++ @return returns non-zero value on failures and prints error message + */ + int fill_problem_data_over_dbus(const char *problem_dir_path, const char **elements, problem_data_t *problem_data); + + /** + @brief Fetches problem information for specified problem id + +- @return problem_data_t or NULL on failure ++ @return a valid pointer to problem_data_t or ERR_PTR on failure + */ + problem_data_t *get_problem_data_dbus(const char *problem_dir_path); + + /** + @brief Fetches full problem data for specified problem id + +- @return problem_data_t or ERR_PTR on failure ++ @return a valid pointer to problem_data_t or ERR_PTR on failure + */ + problem_data_t *get_full_problem_data_over_dbus(const char *problem_dir_path); + +@@ -228,7 +229,8 @@ problem_data_t *get_full_problem_data_over_dbus(const char *problem_dir_path); + @brief Fetches all problems from problem database + + @param authorize If set to true will try to fetch even problems owned by other users (will require root authorization over policy kit) +- @return List of problem ids or NULL on failure ++ ++ @return List of problem ids or ERR_PTR on failure (NULL is an empty list) + */ + GList *get_problems_over_dbus(bool authorize); + +diff --git a/src/lib/problem_api_dbus.c b/src/lib/problem_api_dbus.c +index ce5c47b..0bf86e2 100644 +--- a/src/lib/problem_api_dbus.c ++++ b/src/lib/problem_api_dbus.c +@@ -165,7 +165,7 @@ problem_data_t *get_problem_data_dbus(const char *problem_dir_path) + { + error_msg(_("Can't get problem data from abrt-dbus")); + problem_data_free(pd); +- return NULL; ++ return ERR_PTR; + } + + return pd; +-- +2.4.3 + diff --git a/0013-cli-fix-testing-of-DBus-API-return-codes.patch b/0013-cli-fix-testing-of-DBus-API-return-codes.patch new file mode 100644 index 0000000..39d6e2c --- /dev/null +++ b/0013-cli-fix-testing-of-DBus-API-return-codes.patch @@ -0,0 +1,56 @@ +From a4412db28021552e1399695b3f5435ccbb03bf08 Mon Sep 17 00:00:00 2001 +From: Jakub Filak +Date: Tue, 11 Aug 2015 10:01:53 +0200 +Subject: [PATCH] cli: fix testing of DBus API return codes + +The DBus wrapper functions uses ERR_PTR to report an error, so the +callers has to test the returned pointers for NULL and for ERR_PTR. + +Related: rhbz#1224984 + +Signed-off-by: Jakub Filak +--- + src/cli/list.c | 3 +++ + src/cli/status.c | 5 ++++- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/cli/list.c b/src/cli/list.c +index 68dda47..d069695 100644 +--- a/src/cli/list.c ++++ b/src/cli/list.c +@@ -36,6 +36,9 @@ static problem_data_t *load_problem_data(const char *problem_id) + + /* First, check if there is a problem with the passed id */ + GList *problems = get_problems_over_dbus(g_cli_authenticate); ++ if (problems == ERR_PTR) ++ return NULL; ++ + GList *item = g_list_find_custom(problems, problem_id, (GCompareFunc)strcmp); + + /* (git requires at least 5 char hash prefix, we do the same) */ +diff --git a/src/cli/status.c b/src/cli/status.c +index 0635289..3620cea 100644 +--- a/src/cli/status.c ++++ b/src/cli/status.c +@@ -27,6 +27,9 @@ static unsigned int count_problem_dirs(unsigned long since) + unsigned count = 0; + + GList *problems = get_problems_over_dbus(g_cli_authenticate); ++ if (problems == ERR_PTR) ++ return count; ++ + for (GList *iter = problems; iter != NULL; iter = g_list_next(iter)) + { + const char *problem_id = (const char *)iter->data; +@@ -37,7 +40,7 @@ static unsigned int count_problem_dirs(unsigned long since) + } + + char *time_str = load_text_over_dbus(problem_id, FILENAME_LAST_OCCURRENCE); +- if (time_str == NULL) ++ if (time_str == ERR_PTR || time_str == NULL) + { + log_debug("Not counting problem %s: failed to get time element", problem_id); + continue; +-- +2.4.3 + diff --git a/0014-ccpp-fix-comment-related-to-MakeCompatCore-option-in.patch b/0014-ccpp-fix-comment-related-to-MakeCompatCore-option-in.patch new file mode 100644 index 0000000..1fdc30f --- /dev/null +++ b/0014-ccpp-fix-comment-related-to-MakeCompatCore-option-in.patch @@ -0,0 +1,59 @@ +From affc4b3e644931820180aec57e128106e44b626c Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Tue, 11 Aug 2015 16:17:40 +0200 +Subject: [PATCH] ccpp: fix comment related to 'MakeCompatCore' option in + CCpp.conf + +The comment fits only on the default core_pattern template. +If the core_pattern is not default, the comment does not fit. + +Related to rhbz#1252384 + +Signed-off-by: Matej Habrnal +--- + doc/abrt-CCpp.conf.txt | 9 +++++++-- + src/hooks/CCpp.conf | 9 +++++++-- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/doc/abrt-CCpp.conf.txt b/doc/abrt-CCpp.conf.txt +index 498d53d..cf9b213 100644 +--- a/doc/abrt-CCpp.conf.txt ++++ b/doc/abrt-CCpp.conf.txt +@@ -11,8 +11,13 @@ The configuration file consists of items in the format "Option = Value". + Ithe following items are recognized: + + MakeCompatCore = 'yes' / 'no' ...:: +- If you also want to dump file named "core" +- in crashed process' current dir, set to "yes". ++ CCpp hook writes its template to the "/proc/sys/kernel/core_pattern" file ++ and stores the original template in the "/var/run/abrt/saved_core_pattern" ++ file. If you want CCpp hook to create a core dump file named according to ++ the original template as well, set 'MakeCompatCore' to 'yes'. ++ If the original template string starts with "|", the string "core" is used ++ instead of the template. ++ For more information about naming core dump files see 'man 5 core'. + + SaveBinaryImage = 'yes' / 'no' ...:: + Do you want a copy of crashed binary be saved? +diff --git a/src/hooks/CCpp.conf b/src/hooks/CCpp.conf +index 92d7438..03b9b03 100644 +--- a/src/hooks/CCpp.conf ++++ b/src/hooks/CCpp.conf +@@ -1,7 +1,12 @@ + # Configuration file for CCpp hook + +-# If you also want to dump file named "core" +-# in crashed process' current dir, set to "yes" ++# CCpp hook writes its template to the "/proc/sys/kernel/core_pattern" file ++# and stores the original template in the "/var/run/abrt/saved_core_pattern" ++# file. If you want CCpp hook to create a core dump file named according to ++# the original template as well, set 'MakeCompatCore' to 'yes'. ++# If the original template string starts with "|", the string "core" is used ++# instead of the template. ++# For more information about naming core dump files see 'man 5 core'. + MakeCompatCore = yes + + # Do you want a copy of crashed binary be saved? +-- +2.4.3 + diff --git a/0015-ccpp-use-global-TID.patch b/0015-ccpp-use-global-TID.patch new file mode 100644 index 0000000..e5601ce --- /dev/null +++ b/0015-ccpp-use-global-TID.patch @@ -0,0 +1,37 @@ +From fbb66dec11a7e8503b0cfb9b2c85e94f6b00f4a3 Mon Sep 17 00:00:00 2001 +From: Jakub Filak +Date: Wed, 12 Aug 2015 17:40:12 +0200 +Subject: [PATCH] ccpp: use global TID + +'%i' is TID of the thread from the crashed process's PID namespace but +abrt-hook-ccpp is run by kernel in the init PID namespace, so '%i' +is TID of a completely unrelated process. + +For mode details see 'man 5 core'. + +Related: rhbz#1252590 + +Signed-off-by: Jakub Filak +--- + src/hooks/abrt-install-ccpp-hook.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/hooks/abrt-install-ccpp-hook.in b/src/hooks/abrt-install-ccpp-hook.in +index 13832ab..707c57d 100755 +--- a/src/hooks/abrt-install-ccpp-hook.in ++++ b/src/hooks/abrt-install-ccpp-hook.in +@@ -11,9 +11,9 @@ SAVED_PATTERN_DIR="@VAR_RUN@/abrt" + SAVED_PATTERN_FILE="@VAR_RUN@/abrt/saved_core_pattern" + HOOK_BIN="@libexecdir@/abrt-hook-ccpp" + # Must match percent_specifiers[] order in abrt-hook-ccpp.c: +-PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %i" ++PATTERN="|$HOOK_BIN %s %c %p %u %g %t %e %P %I" + # Same, but with bogus "executable name" parameter +-PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %i" ++PATTERN1="|$HOOK_BIN %s %c %p %u %g %t e %P %I" + + # core_pipe_limit specifies how many dump_helpers can run at the same time + # 0 - means unlimited, but it's not guaranteed that /proc/ of crashing +-- +2.4.3 + diff --git a/abrt.spec b/abrt.spec index 985139d..a3d1922 100644 --- a/abrt.spec +++ b/abrt.spec @@ -49,13 +49,13 @@ Summary: Automatic bug detection and reporting tool Name: abrt Version: 2.6.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/System URL: https://abrt.readthedocs.org/ Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz # don't remove this patch, packages in rawhide are not signed! -Patch0: disable-OpenGPGCheck-in-Fedora-Rawhide.patch +#Patch0: disable-OpenGPGCheck-in-Fedora-Rawhide.patch # git format-patch %%{Version} --topo-order -N -M; # i=1; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done @@ -67,6 +67,13 @@ Patch0005: 0005-abrtd-de-prioritize-post-create-event-scripts.patch Patch0006: 0006-abrt-Fixup-component-of-select-kernel-backtraces.patch Patch0007: 0007-ccpp-do-not-crash-if-generate_core_backtrace-fails.patch Patch0008: 0008-applet-do-not-crash-if-the-new-problem-has-no-comman.patch +Patch0009: 0009-abrt-merge-pstoreoops-merge-files-in-descending-orde.patch +Patch0010: 0010-abrt-auto-reporting-fix-related-to-conditional-compi.patch +Patch0011: 0011-doc-fix-related-to-conditional-compilation-of-man-pa.patch +Patch0012: 0012-dbus-api-unify-reporting-of-errors.patch +Patch0013: 0013-cli-fix-testing-of-DBus-API-return-codes.patch +Patch0014: 0014-ccpp-fix-comment-related-to-MakeCompatCore-option-in.patch +Patch0015: 0015-ccpp-use-global-TID.patch # '%%autosetup -S git' -> git BuildRequires: git @@ -1054,6 +1061,15 @@ killall abrt-dbus >/dev/null 2>&1 || : %config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh %changelog +* Fri Aug 14 2015 Matej Habrnal 2.6.1-3 +- ccpp: use global TID +- fix comment related to 'MakeCompatCore' option in CCpp.conf +- fix testing of DBus API return codes +- dbus-api: unify reporting of errors +- fix related to conditional compilation of man page +- abrt-auto-reporting: fix related to conditional compilation +- abrt-merge-pstoreoops: merge files in descending order + * Tue Jul 21 2015 Jakub Filak 2.6.1-2 - applet: do not crash if the new problem has no command_line - ccpp: do not crash if generate_core_backtrace fails