Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1984921

Summary: device-mapper-multipath: FTBFS due to type of PTHREAD_STACK_MIN in glibc 2.34
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED CURRENTRELEASE QA Contact: Lin Li <lilin>
Severity: medium Docs Contact:
Priority: medium    
Version: CentOS StreamCC: agk, bmarzins, bstinson, cfeist, extras-qa, heinzm, jwboyer, kzak, lilin, lvm-team, mcsontos, msnitzer, prajnoha, prockai, zkabelac
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: device-mapper-multipath-0.8.6-5.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1984919 Environment:
Last Closed: 2021-12-07 21:52:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1984919    
Bug Blocks:    

Description Florian Weimer 2021-07-22 13:29:16 UTC
+++ This bug was initially created as a clone of Bug #1984919 +++

Building device-mapper-multipath against glibc 2.34 results in the following build failure:

util.c: In function 'setup_thread_attr':
util.c:226:23: error: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'long int' [-Werror=sign-compare]
  226 |         if (stacksize < PTHREAD_STACK_MIN)
      |                       ^
cc1: all warnings being treated as errors
make[1]: *** [../Makefile.inc:154: util.o] Error 1

The reason for the warning is that PTHREAD_STACK_MIN is now non-constant and has type long int. Previously its type was int, but it was a constant, so the compiler was able to suppress the warning.

Comment 1 Ben Marzinski 2021-08-02 21:07:59 UTC
It obviously builds now, so you should just be able to set Verified:Tested.

Comment 5 Lin Li 2021-08-05 08:02:57 UTC
The 0022-multipathd-cli_handlers-cleanup-setting-reply-length.patch applied from spec file and source code.

# cat 0022-multipathd-cli_handlers-cleanup-setting-reply-length.patch
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck>
Date: Mon, 17 May 2021 22:37:34 +0200
Subject: [PATCH] multipathd: cli_handlers: cleanup setting reply length

Create a macro for setting the reply length for string literals
correctly, and use it where necessary.

In cli_del_path(), don't change the function's return code
if just the buffer allocation for the reply failed.

Reviewed-by: Benjamin Marzinski <bmarzins>
Signed-off-by: Benjamin Marzinski <bmarzins>
---
 multipathd/cli_handlers.c | 33 ++++++++++++---------------------
 1 file changed, 12 insertions(+), 21 deletions(-)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 6765fcf0..96064944 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -32,6 +32,12 @@
 #include "foreign.h"
 #include "cli_handlers.h"
 
+#define SET_REPLY_AND_LEN(__rep, __len, string_literal)	\
+	do {							\
+		*(__rep) = strdup(string_literal);		\
+		*(__len) = *(__rep) ? sizeof(string_literal) : 0;\
+	} while (0)
+
 int
 show_paths (char ** r, int * len, struct vectors * vecs, char * style,
 	    int pretty)
@@ -802,8 +808,7 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
 	}
 	return ev_add_path(pp, vecs, 1);
 blacklisted:
-	*reply = strdup("blacklisted\n");
-	*len = strlen(*reply) + 1;
+	SET_REPLY_AND_LEN(reply, len, "blacklisted\n");
 	condlog(2, "%s: path blacklisted", param);
 	return 0;
 }
@@ -824,23 +829,10 @@ cli_del_path (void * v, char ** reply, int * len, void * data)
 		return 1;
 	}
 	ret = ev_remove_path(pp, vecs, 1);
-	if (ret == REMOVE_PATH_DELAY) {
-		*reply = strdup("delayed\n");
-		if (*reply)
-			*len = strlen(*reply) + 1;
-		else {
-			*len = 0;
-			ret = REMOVE_PATH_FAILURE;
-		}
-	} else if (ret == REMOVE_PATH_MAP_ERROR) {
-		*reply = strdup("map reload error. removed\n");
-		if (*reply)
-			*len = strlen(*reply) + 1;
-		else {
-			*len = 0;
-			ret = REMOVE_PATH_FAILURE;
-		}
-	}
+	if (ret == REMOVE_PATH_DELAY)
+		SET_REPLY_AND_LEN(reply, len, "delayed\n");
+	else if (ret == REMOVE_PATH_MAP_ERROR)
+		SET_REPLY_AND_LEN(reply, len, "map reload error. removed\n");
 	return (ret == REMOVE_PATH_FAILURE);
 }
 
@@ -865,8 +857,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data)
 		invalid = 1;
 	pthread_cleanup_pop(1);
 	if (invalid) {
-		*reply = strdup("blacklisted\n");
-		*len = strlen(*reply) + 1;
+		SET_REPLY_AND_LEN(reply, len, "blacklisted\n");
 		condlog(2, "%s: map blacklisted", param);
 		return 1;
 	}