pacemaker/Build-fix-compilation-Werror-compilation-issue.patch
Jan Pokorný 2957abde8a
2.0.3-4 - return back to building also for s390x architecture
...was identified and interim fix (way to build along with one
  actual bugfix as raised along) applied (RHBZ#1799842)

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2020-03-06 18:08:07 +01:00

95 lines
4.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 9acf1f9b3d42ce48044568230cb4eba6a52b2e27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
Date: Wed, 4 Mar 2020 23:42:33 +0100
Subject: [PATCH] Build: fix compilation -Werror compilation issue with GCC 10
with s390x
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Curiously, this possible NULL propagation:
> In file included from ../../include/crm_internal.h:21,
> from utils.c:10:
> In function pe_action_set_reason,
> inlined from custom_action at utils.c:605:13:
> ../../include/crm/common/logging.h:235:13: error: %s directive argument is null [-Werror=format-overflow=]
> 235 | qb_log_from_external_source(__func__, __FILE__, fmt, level, \
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 236 | __LINE__, converted_tag , ##args); \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./../include/crm/pengine/internal.h:19:43: note: in expansion of macro crm_log_tag
> 19 | # define pe_rsc_trace(rsc, fmt, args...) crm_log_tag(LOG_TRACE, rsc ? rsc->id : "<NULL>", fmt, ##args)
> | ^~~~~~~~~~~
> utils.c:2502:9: note: in expansion of macro pe_rsc_trace
> 2502 | pe_rsc_trace(action->rsc, "Changing %s reason from '%s' to '%s'", action->uuid, action->reason, reason);
> | ^~~~~~~~~~~~
> tils.c: In function custom_action:
> tils.c:2502:69: note: format string is defined here
> 2502 | pe_rsc_trace(action->rsc, "Changing %s reason from '%s' to '%s'", action->uuid, action->reason, reason);
> | ^~
was not observed with other architectures with a Rawhide rebuild.
There are various hypotheses behind that, currently concentrated
around a suspicion that "-fPIC" vs. building lacking that, which
is what libtool performs sequentially both unless the project is
configured with --disable-static (current stopgap solution for
said Rawhide/s390x problem) will mean that under some additional
circumstances, more interprocedural (or even cross-file?) data
flow analysis can be made and hence more problematic situations
discovered. To add insult into injury, libtool would purposefully
(and perhaps mistakenly) hide any outputs of possibly failing
second compilation pass per above when the former succeeded.
[Due to resorting to said --disable-static, further occurrences
of "new" problems are not being pursued at this time.]
Special thanks to Dan Horák for providing an instant feedback
based on some Fedora automatic notification triggers:
https://bugzilla.redhat.com/show_bug.cgi?id=1799842#c11
Also of interest, reduce double message to single one only
in one particular combination.
---
lib/pengine/utils.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c
index 81f91215f3..6c82105f61 100644
--- a/lib/pengine/utils.c
+++ b/lib/pengine/utils.c
@@ -2551,18 +2551,22 @@ void pe_action_set_flag_reason(const char *function, long line,
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
{
- if(action->reason && overwrite) {
- pe_rsc_trace(action->rsc, "Changing %s reason from '%s' to '%s'", action->uuid, action->reason, reason);
+ if (action->reason != NULL && overwrite) {
+ pe_rsc_trace(action->rsc, "Changing %s reason from '%s' to '%s'",
+ action->uuid, action->reason, crm_str(reason));
free(action->reason);
- action->reason = NULL;
+ } else if (action->reason == NULL) {
+ pe_rsc_trace(action->rsc, "Set %s reason to '%s'",
+ action->uuid, crm_str(reason));
+ } else {
+ // crm_assert(action->reason != NULL && !overwrite);
+ return;
}
- if(action->reason == NULL) {
- if(reason) {
- pe_rsc_trace(action->rsc, "Set %s reason to '%s'", action->uuid, reason);
- action->reason = strdup(reason);
- } else {
- action->reason = NULL;
- }
+
+ if (reason != NULL) {
+ action->reason = strdup(reason);
+ } else {
+ action->reason = NULL;
}
}