multipath-tools tests: fix stringop-overflow build errors with gcc 11
PATCH 1/1 multipath-tools tests: fix stringop-overflow build errors with gcc 11
From: Martin Wilck <[email protected]>
gcc-11 throws an error compiling alias.c and dmevents.c:
In file included from ../libmultipath/checkers.h:4,
from ../libmultipath/prio.h:7,
from ../libmultipath/structs.h:8,
from dmevents.c:29:
../multipathd/dmevents.c: In function 'dmevent_loop':
../multipathd/dmevents.c:357:17: error: '__sigsetjmp' accessing 200 bytes in a region of size 72 [-Werror=stringop-overflow=]
357 | pthread_cleanup_push(cleanup_lock, &waiter->vecs->lock);
| ^~~~~~~~~~~~~~~~~~~~
../multipathd/dmevents.c:357:17: note: referencing argument 1 of type 'struct __jmp_buf_tag *'
/usr/include/pthread.h:734:12: note: in a call to function '__sigsetjmp'
734 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
| ^~~~~~~~~~~The reason seems to be a mismatch between the __sigsetjmp() prototype in <setjmp.h> and <pthread.h>. Until this is fixed in the toolchain, work around it by including <pthread.h> first.
--- tests/alias.c | 1 + tests/dmevents.c | 1 + 2 files changed, 2 insertions(+)
tests/alias.c +1 -0
@@ -1,3 +1,4 @@ +#include <pthread.h> #include <stdint.h> #include <setjmp.h> #include <stdio.h>
tests/dmevents.c +1 -0
@@ -16,6 +16,7 @@* */ +#include <pthread.h> #include <stdint.h> #include <stdbool.h> #include <stdarg.h>
Signature · 7 lines
2.29.2 -- dm-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 22 lines · On Wed, 2021-02-10 at 13:24 +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
gcc-11 throws an error compiling
alias.canddmevents.c:In file included from
../libmultipath/checkers.h:4,
from../libmultipath/prio.h:7,
from../libmultipath/structs.h:8,
from dmevents.c:29:../multipathd/dmevents.c: In function 'dmevent_loop':../multipathd/dmevents.c:357:17: error: '__sigsetjmp' accessing 200 bytes in a region of size 72 [-Werror=stringop-overflow=] 357 | pthread_cleanup_push(cleanup_lock, &waiter-Quoted 1 line
vecs->lock);| ^~~~~~~~~~~~~~~~~~~~
../multipathd/dmevents.c:357:17: note: referencing argument 1 of type 'struct__jmp_buf_tag*'/usr/include/pthread.h:734:12: note: in a call to function '__sigsetjmp'
734 | extern int__sigsetjmp(struct__jmp_buf_tag*__env, int__savemask)__THROWNL;
| ^~~~~~~~~~~
Quoted 5 lines
The reason seems to be a mismatch between the
__sigsetjmp()prototype in <setjmp.h> and <pthread.h>. Until this is fixed in the toolchain, work around it by including <pthread.h> first.Signed-off-by Martin Wilck <[email protected]>
I'm told that this issue is related to this glibc bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=26647
and should be fixed in glibc 2.33. Yet adding this patch doesn't hurt us and can serve as a workaround for environments with gcc 11.
Regards
Martin
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 6 lines · Martin Wilck
I'm told that this issue is related to this glibc bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=26647and should be fixed in glibc 2.33. Yet adding this patch doesn't hurt us and can serve as a workaround for environments with gcc 11.
Christophe, I've pushed this to my "fixes" branch.
Regards
Martin
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel
Quoted 17 lines · On Wed, Feb 10, 2021 at 01:24:57PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
gcc-11 throws an error compiling
alias.canddmevents.c:In file included from
../libmultipath/checkers.h:4,from ../libmultipath/prio.h:7, from ../libmultipath/structs.h:8, from dmevents.c:29: ../multipathd/dmevents.c: In function 'dmevent_loop': ../multipathd/dmevents.c:357:17: error: '__sigsetjmp' accessing 200 bytes in a region of size 72 [-Werror=stringop-overflow=] 357 | pthread_cleanup_push(cleanup_lock, &waiter->vecs->lock); | ^~~~~~~~~~~~~~~~~~~~ ../multipathd/dmevents.c:357:17: note: referencing argument 1 of type 'struct __jmp_buf_tag *' /usr/include/pthread.h:734:12: note: in a call to function '__sigsetjmp' 734 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; | ^~~~~~~~~~~
Quoted 4 lines
The reason seems to be a mismatch between the
__sigsetjmp()prototype in <setjmp.h> and <pthread.h>. Until this is fixed in the toolchain, work around it by including <pthread.h> first.
Quoted 29 lines
Signed-off-by Martin Wilck <[email protected]>--- tests/alias.c | 1 + tests/dmevents.c | 1 + 2 files changed, 2 insertions(+)tests/alias.c +1
-0@@ -1,3 +1,4 @@ +#include <pthread.h> #include <stdint.h> #include <setjmp.h> #include <stdio.h> tests/dmevents.c +1
-0@@ -16,6 +16,7 @@* */ +#include <pthread.h> #include <stdint.h> #include <stdbool.h> #include <stdarg.h> Signature · 1 line
2.29.2
--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel