Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.8.1] gcc 9.3.1 can't build the source code #651

Closed
tuxmaster5000 opened this issue Feb 9, 2021 · 1 comment
Closed

[20.8.1] gcc 9.3.1 can't build the source code #651

tuxmaster5000 opened this issue Feb 9, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@tuxmaster5000
Copy link
Contributor

The build on CentOS7 fails with:

cd /builddir/build/BUILD/openvas-20.8.1/my_build/misc && /usr/lib64/ccache/cc -DOPENVAS_DATA_DIR=\"/usr/share/openvas\" -DOPENVAS_FEED_LOCK_PATH=\"/run/greenbone/feed-update.lock\" -DOPENVAS_STATE_DIR=\"/var/lib/greenbone/lib/openvas\" -DOPENVAS_SYSCONF_DIR=\"/etc/openvas\" -Dopenvas_misc_shared_EXPORTS -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gvm -I/usr/include/gvm-helper  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1  -m64 -mtune=generic -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE=1 -Wall -D_BSD_SOURCE -D_ISOC99_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -Wall -Wextra -fPIC -g  -Werror -fPIC   -o CMakeFiles/openvas_misc_shared.dir/strutils.c.o   -c /builddir/build/BUILD/openvas-20.8.1/misc/strutils.c
In file included from /usr/include/string.h:638,
                 from /usr/include/glib-2.0/glib/gtestutils.h:30,
                 from /usr/include/glib-2.0/glib.h:82,
                 from /builddir/build/BUILD/openvas-20.8.1/misc/scanneraux.h:28,
                 from /builddir/build/BUILD/openvas-20.8.1/misc/network.h:29,
                 from /builddir/build/BUILD/openvas-20.8.1/misc/pcap.c:22:
In function 'strncpy',
    inlined from 'getinterfaces' at /builddir/build/BUILD/openvas-20.8.1/misc/pcap.c:461:7:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' output may be truncated copying 63 bytes from a string of length 10239 [-Werror=stringop-truncation]
  120 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
    inlined from 'getipv4routes' at /builddir/build/BUILD/openvas-20.8.1/misc/pcap.c:625:11:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation]
  120 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
    inlined from 'routethrough' at /builddir/build/BUILD/openvas-20.8.1/misc/pcap.c:1117:15:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' specified bound 64 equals destination size [-Werror=stringop-truncation]
  120 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [misc/CMakeFiles/openvas_misc_shared.dir/pcap.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/builddir/build/BUILD/openvas-20.8.1/my_build'
make[1]: Leaving directory `/builddir/build/BUILD/openvas-20.8.1/my_build'
make[1]: *** [misc/CMakeFiles/openvas_misc_shared.dir/all] Error 2
make: *** [all] Error 2

When the source code is safe, then an gcc pragma statement can be used.

@tuxmaster5000 tuxmaster5000 added the bug Something isn't working label Feb 9, 2021
@tuxmaster5000
Copy link
Contributor Author

The PR is only an hot fix, some one with deep source code knowledge can provide an better patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants