[Bug 1974069] [NEW] warning: ‘__builtin_memset’ specified size between 18446744071562067968 and 184467440737095516 15 exceeds maximum object size 9223372036854775807
Steve Langasek
1974069 at bugs.launchpad.net
Wed May 18 17:24:59 UTC 2022
Public bug reported:
The scotch autopkgtest is failing on ppc64el in kinetic because the
compiler is outputting a warning to stderr:
[...]
mpicc -O3 -fPIC -I. -I/usr/include/metis -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_LZMA -DSCOTCH_PTHREAD -DCOMMON_PTHREAD -DSCOTCH_PTHREAD_NUMBER=2 -DCOMMON_PTHREAD_FILE -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_RENAME_PARSER -I/usr/include/scotch -L/usr/lib/powerpc64le-linux-gnu test_scotch_graph_induce.c -o test_scotch_graph_induce -lscotch -lscotcherr -lm
In file included from /usr/include/string.h:535,
from test_scotch_graph_induce.c:59:
In function 'memset',
inlined from 'main' at test_scotch_graph_induce.c:134:3:
/usr/include/powerpc64le-linux-gnu/bits/string_fortified.h:59:10: warning: '__builtin_memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
59 | return __builtin___memset_chk (__dest, __ch, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
(https://autopkgtest.ubuntu.com/results/autopkgtest-
kinetic/kinetic/ppc64el/s/scotch/20220509_164658_7d31d@/log.gz)
Reproducible when invoking gcc directly instead of via the mpicc
wrapper; also reproducible with gcc -O2 instead of gcc -O3.
This warning is patently nonsense. The size ranges listed is, in hex,
0xFFFFFFFF80000000-0xFFFFFFFFFFFFFFFF. We are not trying to memset an
object of that size, and at runtime there is no problem with the actual
behavior.
So something is wrong with gcc's calculation here, resulting in a
spurious warning.
This issue was not reproduced when the autopkgtest ran on ppc64el in
Debian. I don't know why, as the compiler should be essentially the
same between Debian and Ubuntu - and I've ruled out this being a problem
of the -O3 default that exists in Ubuntu packaging but not in Debian.
** Affects: gcc-11 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-11 in Ubuntu.
https://bugs.launchpad.net/bugs/1974069
Title:
warning: ‘__builtin_memset’ specified size between
18446744071562067968 and 184467440737095516 15 exceeds maximum object
size 9223372036854775807
Status in gcc-11 package in Ubuntu:
New
Bug description:
The scotch autopkgtest is failing on ppc64el in kinetic because the
compiler is outputting a warning to stderr:
[...]
mpicc -O3 -fPIC -I. -I/usr/include/metis -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_LZMA -DSCOTCH_PTHREAD -DCOMMON_PTHREAD -DSCOTCH_PTHREAD_NUMBER=2 -DCOMMON_PTHREAD_FILE -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_RENAME_PARSER -I/usr/include/scotch -L/usr/lib/powerpc64le-linux-gnu test_scotch_graph_induce.c -o test_scotch_graph_induce -lscotch -lscotcherr -lm
In file included from /usr/include/string.h:535,
from test_scotch_graph_induce.c:59:
In function 'memset',
inlined from 'main' at test_scotch_graph_induce.c:134:3:
/usr/include/powerpc64le-linux-gnu/bits/string_fortified.h:59:10: warning: '__builtin_memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
59 | return __builtin___memset_chk (__dest, __ch, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | __glibc_objsize0 (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
(https://autopkgtest.ubuntu.com/results/autopkgtest-
kinetic/kinetic/ppc64el/s/scotch/20220509_164658_7d31d@/log.gz)
Reproducible when invoking gcc directly instead of via the mpicc
wrapper; also reproducible with gcc -O2 instead of gcc -O3.
This warning is patently nonsense. The size ranges listed is, in hex,
0xFFFFFFFF80000000-0xFFFFFFFFFFFFFFFF. We are not trying to memset an
object of that size, and at runtime there is no problem with the
actual behavior.
So something is wrong with gcc's calculation here, resulting in a
spurious warning.
This issue was not reproduced when the autopkgtest ran on ppc64el in
Debian. I don't know why, as the compiler should be essentially the
same between Debian and Ubuntu - and I've ruled out this being a
problem of the -O3 default that exists in Ubuntu packaging but not in
Debian.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-11/+bug/1974069/+subscriptions
More information about the foundations-bugs
mailing list