[LU-11233] gcc8 support Created: 10/Aug/18 Updated: 08/Jun/19 Resolved: 29/May/19 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.13.0, Lustre 2.12.3 |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Alex Zhuravlev | Assignee: | Alex Zhuravlev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||
| Description |
|
gcc8 introduces number of new checks (especially in string manipulation area) preventing builds
|
| Comments |
| Comment by Gerrit Updater [ 10/Aug/18 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/32978 |
| Comment by Gerrit Updater [ 15/Apr/19 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34660 |
| Comment by Gerrit Updater [ 15/Apr/19 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34661 |
| Comment by Gerrit Updater [ 15/Apr/19 ] |
|
Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34662 |
| Comment by Dongyang Li [ 16/Apr/19 ] |
|
Alex, please add something like this below to https://review.whamcloud.com/#/c/34662/ to make server utils build with gcc8: diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 1acd6353a0..c3dcf5e62c 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -348,7 +348,7 @@ int parse_options(struct mount_opts *mop, char *orig_options, free(options); return EINVAL; } - strncpy(mop->mo_skpath, val + 1, strlen(val + 1)); + strncpy(mop->mo_skpath, val + 1, strlen(mop->mo_skpath) - 1); #endif } else if (parse_one_option(opt, flagp) == 0) { /* pass this on as an option */ |
| Comment by Alex Zhuravlev [ 16/Apr/19 ] |
|
dongyang please tell what exact gcc you are using |
| Comment by Dongyang Li [ 17/Apr/19 ] |
[root@rhel8 ~]# gcc --version gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| Comment by Alex Zhuravlev [ 17/Apr/19 ] |
|
gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC) ah, GSS support is disabled in my case.. |
| Comment by Dongyang Li [ 17/Apr/19 ] |
|
Yes it should be sizeof(mop->mo_skpath) here, my bad. with the above patches and the change I mentioned, I was able to build all the modules/utils with gcc8 on rhel8. |
| Comment by Gerrit Updater [ 18/Apr/19 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34711 |
| Comment by Gerrit Updater [ 04/May/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34660/ |
| Comment by Gerrit Updater [ 04/May/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34711/ |
| Comment by Jian Yu [ 22/May/19 ] |
|
Hi Alex, 00:35:12 liblnetconfig.c: In function 'yaml_copy_peer_nids': 00:35:12 liblnetconfig.c:4321:3: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] 00:35:12 strncpy(nids[num], entry->cy_valuestring, 00:35:12 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00:35:12 strlen(entry->cy_valuestring)); 00:35:12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00:35:12 liblnetconfig.c: In function 'lnet_expr2ips': 00:35:12 liblnetconfig.c:722:30: error: '%s' directive output may be truncated writing up to 127 bytes into a region of size 104 [-Werror=format-truncation=] 00:35:12 "\"cannot parse ip_range '%s'\"", ip_range); 00:35:12 ^~ ~~~~~~~~ 00:35:12 liblnetconfig.c:720:3: note: 'snprintf' output between 27 and 154 bytes into a destination of size 128 00:35:12 snprintf(err_str, 00:35:12 ^~~~~~~~~~~~~~~~~ 00:35:12 LNET_MAX_STR_LEN, 00:35:12 ~~~~~~~~~~~~~~~~~ 00:35:12 "\"cannot parse ip_range '%s'\"", ip_range); 00:35:12 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00:35:12 cc1: all warnings being treated as errors However, the output of configure was: 00:21:24 checking for -Wno-format-truncation support... yes 00:21:24 checking for -Wno-stringop-truncation support... yes 00:21:24 checking for -Wno-stringop-overflow support... yes <~snip~> 00:21:28 EXTRA_KCFLAGS: -include /var/lib/jenkins/workspace/lustre-reviews/arch/x86_64/build_type/client/distro/el8/ib_stack/inkernel/BUILD/lustre/undef.h -include /var/lib/jenkins/workspace/lustre-reviews/arch/x86_64/build_type/client/distro/el8/ib_stack/inkernel/BUILD/lustre/config.h -g -I/var/lib/jenkins/workspace/lustre-reviews/arch/x86_64/build_type/client/distro/el8/ib_stack/inkernel/BUILD/lustre/libcfs/include -I/var/lib/jenkins/workspace/lustre-reviews/arch/x86_64/build_type/client/distro/el8/ib_stack/inkernel/BUILD/lustre/lnet/include -I/var/lib/jenkins/workspace/lustre-reviews/arch/x86_64/build_type/client/distro/el8/ib_stack/inkernel/BUILD/lustre/lustre/include -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow "-Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow" were specified in EXTRA_KCFLAGS but they didn't work. gcc version is 8.2.1. Could you please advise? |
| Comment by Gerrit Updater [ 25/May/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34662/ |
| Comment by Gerrit Updater [ 29/May/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34661/ |
| Comment by Peter Jones [ 29/May/19 ] |
|
Landed for 2.13 |
| Comment by Gerrit Updater [ 30/May/19 ] |
|
Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35002 |
| Comment by Gerrit Updater [ 30/May/19 ] |
|
Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35003 |
| Comment by Gerrit Updater [ 30/May/19 ] |
|
Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35004 |
| Comment by Gerrit Updater [ 30/May/19 ] |
|
Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35005 |
| Comment by Gerrit Updater [ 08/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35003/ |
| Comment by Gerrit Updater [ 08/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35004/ |
| Comment by Gerrit Updater [ 08/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35005/ |
| Comment by Gerrit Updater [ 08/Jun/19 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35002/ |