Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • Lustre 2.13.0, Lustre 2.12.3
    • None
    • None
    • 9223372036854775807

    Description

      gcc8 introduces number of new checks (especially in string manipulation area) preventing builds

       

      Attachments

        Issue Links

          Activity

            [LU-11233] gcc8 support

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34660/
            Subject: LU-11233 build: support for gcc8
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 6601661f96325b4971d0d1cb0be0fa01cc2ddc97

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/34660/ Subject: LU-11233 build: support for gcc8 Project: fs/lustre-release Branch: master Current Patch Set: Commit: 6601661f96325b4971d0d1cb0be0fa01cc2ddc97

            Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34711
            Subject: LU-11233 utils: fix double-free of params fields
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 01eb91f826be2531f707540e57266fc04f7d2c67

            gerrit Gerrit Updater added a comment - Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34711 Subject: LU-11233 utils: fix double-free of params fields Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 01eb91f826be2531f707540e57266fc04f7d2c67
            dongyang Dongyang Li added a comment -

            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.

            dongyang Dongyang Li added a comment - 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.

            gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC)

            ah, GSS support is disabled in my case..
            but I gues you really meant not strlen(mop->mo_skpath), but rather sizeof(mop->mo_skpath) ?

            bzzz Alex Zhuravlev added a comment - gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC) ah, GSS support is disabled in my case.. but I gues you really meant not strlen(mop->mo_skpath), but rather sizeof(mop->mo_skpath) ?
            dongyang Dongyang Li added a comment -
            [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.
            
            dongyang Dongyang Li added a comment - [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.

            dongyang please tell what exact gcc you are using

            bzzz Alex Zhuravlev added a comment - dongyang please tell what exact gcc you are using
            dongyang Dongyang Li added a comment -

            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 */
            
            dongyang Dongyang Li added a comment - 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 */

            Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34662
            Subject: LU-11233 build: support for gcc8
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: ae3e0118240849c89ac3b222ef38ddc7184bd29a

            gerrit Gerrit Updater added a comment - Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34662 Subject: LU-11233 build: support for gcc8 Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: ae3e0118240849c89ac3b222ef38ddc7184bd29a

            Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34661
            Subject: LU-11233 build: support for gcc8
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 973f4ffb776303c8caddbc6e507d0d5c7c75f4ee

            gerrit Gerrit Updater added a comment - Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34661 Subject: LU-11233 build: support for gcc8 Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 973f4ffb776303c8caddbc6e507d0d5c7c75f4ee

            Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34660
            Subject: LU-11233 build: support for gcc8
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 76e3fc7e99538ce73708514863e63467066dced8

            gerrit Gerrit Updater added a comment - Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/34660 Subject: LU-11233 build: support for gcc8 Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 76e3fc7e99538ce73708514863e63467066dced8

            Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/32978
            Subject: LU-11233 build: gcc8 support
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 94f34bfcde638b7d3535154c04907544ca4b6fce

            gerrit Gerrit Updater added a comment - Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/32978 Subject: LU-11233 build: gcc8 support Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 94f34bfcde638b7d3535154c04907544ca4b6fce

            People

              bzzz Alex Zhuravlev
              bzzz Alex Zhuravlev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: