Details

    • Technical task
    • Resolution: Fixed
    • Minor
    • Lustre 2.2.0
    • Lustre 2.2.0
    • FC13 running clang-analyzer-2.8-10.fc13.x86_64
    • 4812

    Description

      Tracking bug for warnings produced by the clang-analyzer static code analysis tool.

      The first one is a trivial printk() format warning due to the use of "%Lu" for LPU64, and other places in the code. The "%L" format specifier is a GCCism that is deprecated in favor of "%ll" from C99.

      Attachments

        Issue Links

          Activity

            [LU-871] clang: minor code cleanups

            Karsten, thanks for submitting these patches. Sorry I didn't reply to this when it was first posted, as it slipped off my radar. Could you please submit these patches to our Gerrit (code review) git repository? Please see http://wiki.whamcloud.com/display/PUB/Using+Gerrit for details.

            This will allow us to review, test, and land the patches to Lustre, and not have them sitting in an attachment here.

            adilger Andreas Dilger added a comment - Karsten, thanks for submitting these patches. Sorry I didn't reply to this when it was first posted, as it slipped off my radar. Could you please submit these patches to our Gerrit (code review) git repository? Please see http://wiki.whamcloud.com/display/PUB/Using+Gerrit for details. This will allow us to review, test, and land the patches to Lustre, and not have them sitting in an attachment here.

            FWIW I've compiled Lustre 2.1.54 patchless client on CentOS 6.2 with Clang's static analyzer (LLVM 3.0).

            I decided to disable the static analyzer check "core.NullDereference" because it detects lots of bugs (521). However, based on a first short glance most of them are dubious because the analyzer seems to get confused by Lustre's LASSERT(). (And including all of these 521 bugs would make the tarball larger than the Jira upload file limit.)

            Here's the bug summary:

            Bug Type Quantity
            All Bugs 270
            API  
            Argument with 'nonnull' attribute passed null 16
            Dead code  
            Idempotent operation 30
            Dead store  
            Dead assignment 120
            Dead increment 6
            Dead initialization 20
            Logic error  
            Assigned value is garbage or undefined 12
            Called function pointer is null (null dereference) 31
            Division by zero 4
            Function call argument is an uninitialized value 14
            Garbage return value 6
            Result of operation is garbage or undefined 8
            Unix API  
            Undefined allocation of 0 bytes 3

            Check out the annotated source in the attached tarball with a web browser.

            This is how the source was compiled:

            touch META
            sh autogen.sh
            scan-build ./configure --disable-server \
            --with-linux=/usr/src/kernels/2.6.32-220.2.1.el6.x86_64 \
            --with-linux-obj=/lib/modules/2.6.32-220.2.1.el6.x86_64/build/ \
            --with-downstream-release=wc1
            mkdir ./lustre-2.1.54-scan-build
            scan-build -o ./lustre-2.1.54-scan-build/ \
            -disable-checker core.NullDereference \
            make -j 24

            knweiss Karsten Weiss added a comment - FWIW I've compiled Lustre 2.1.54 patchless client on CentOS 6.2 with Clang's static analyzer (LLVM 3.0). I decided to disable the static analyzer check "core.NullDereference" because it detects lots of bugs (521). However, based on a first short glance most of them are dubious because the analyzer seems to get confused by Lustre's LASSERT(). (And including all of these 521 bugs would make the tarball larger than the Jira upload file limit.) Here's the bug summary: Bug Type Quantity All Bugs 270 API   Argument with 'nonnull' attribute passed null 16 Dead code   Idempotent operation 30 Dead store   Dead assignment 120 Dead increment 6 Dead initialization 20 Logic error   Assigned value is garbage or undefined 12 Called function pointer is null (null dereference) 31 Division by zero 4 Function call argument is an uninitialized value 14 Garbage return value 6 Result of operation is garbage or undefined 8 Unix API   Undefined allocation of 0 bytes 3 Check out the annotated source in the attached tarball with a web browser. This is how the source was compiled: touch META sh autogen.sh scan-build ./configure --disable-server \ --with-linux=/usr/src/kernels/2.6.32-220.2.1.el6.x86_64 \ --with-linux-obj=/lib/modules/2.6.32-220.2.1.el6.x86_64/build/ \ --with-downstream-release=wc1 mkdir ./lustre-2.1.54-scan-build scan-build -o ./lustre-2.1.54-scan-build/ \ -disable-checker core.NullDereference \ make -j 24

            Integrated in lustre-master » i686,server,el5,ofa #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/utils/gss/lgss_utils.c
            • lustre/llite/file.c
            • lustre/utils/gss/lgss_keyring.c
            • lustre/tests/checkstat.c
            • lustre/fid/lproc_fid.c
            • lustre/liblustre/super.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • lustre/tests/truncate.c
            • lnet/utils/routerstat.c
            • lustre/llite/rw.c
            • lustre/include/lustre_debug.h
            • libcfs/include/libcfs/linux/kp30.h
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » i686,server,el5,ofa #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/utils/gss/lgss_utils.c lustre/llite/file.c lustre/utils/gss/lgss_keyring.c lustre/tests/checkstat.c lustre/fid/lproc_fid.c lustre/liblustre/super.c libcfs/include/libcfs/posix/posix-wordsize.h lustre/tests/truncate.c lnet/utils/routerstat.c lustre/llite/rw.c lustre/include/lustre_debug.h libcfs/include/libcfs/linux/kp30.h

            Integrated in lustre-master » i686,server,el6,inkernel #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/llite/rw.c
            • libcfs/include/libcfs/linux/kp30.h
            • lustre/utils/gss/lgss_utils.c
            • lustre/fid/lproc_fid.c
            • lustre/tests/checkstat.c
            • lustre/liblustre/super.c
            • lustre/tests/truncate.c
            • lustre/utils/gss/lgss_keyring.c
            • lustre/llite/file.c
            • lustre/include/lustre_debug.h
            • lnet/utils/routerstat.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » i686,server,el6,inkernel #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/llite/rw.c libcfs/include/libcfs/linux/kp30.h lustre/utils/gss/lgss_utils.c lustre/fid/lproc_fid.c lustre/tests/checkstat.c lustre/liblustre/super.c lustre/tests/truncate.c lustre/utils/gss/lgss_keyring.c lustre/llite/file.c lustre/include/lustre_debug.h lnet/utils/routerstat.c libcfs/include/libcfs/posix/posix-wordsize.h

            Integrated in lustre-master » i686,server,el5,inkernel #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/utils/gss/lgss_keyring.c
            • lustre/liblustre/super.c
            • lustre/utils/gss/lgss_utils.c
            • lustre/llite/rw.c
            • lustre/tests/checkstat.c
            • lustre/llite/file.c
            • lnet/utils/routerstat.c
            • lustre/tests/truncate.c
            • lustre/fid/lproc_fid.c
            • lustre/include/lustre_debug.h
            • libcfs/include/libcfs/linux/kp30.h
            • libcfs/include/libcfs/posix/posix-wordsize.h
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » i686,server,el5,inkernel #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/utils/gss/lgss_keyring.c lustre/liblustre/super.c lustre/utils/gss/lgss_utils.c lustre/llite/rw.c lustre/tests/checkstat.c lustre/llite/file.c lnet/utils/routerstat.c lustre/tests/truncate.c lustre/fid/lproc_fid.c lustre/include/lustre_debug.h libcfs/include/libcfs/linux/kp30.h libcfs/include/libcfs/posix/posix-wordsize.h

            Integrated in lustre-master » x86_64,server,el5,ofa #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = FAILURE
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • libcfs/include/libcfs/linux/kp30.h
            • lustre/llite/file.c
            • lustre/utils/gss/lgss_utils.c
            • lustre/utils/gss/lgss_keyring.c
            • lustre/tests/truncate.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • lustre/llite/rw.c
            • lnet/utils/routerstat.c
            • lustre/tests/checkstat.c
            • lustre/fid/lproc_fid.c
            • lustre/liblustre/super.c
            • lustre/include/lustre_debug.h
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » x86_64,server,el5,ofa #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = FAILURE Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : libcfs/include/libcfs/linux/kp30.h lustre/llite/file.c lustre/utils/gss/lgss_utils.c lustre/utils/gss/lgss_keyring.c lustre/tests/truncate.c libcfs/include/libcfs/posix/posix-wordsize.h lustre/llite/rw.c lnet/utils/routerstat.c lustre/tests/checkstat.c lustre/fid/lproc_fid.c lustre/liblustre/super.c lustre/include/lustre_debug.h

            Integrated in lustre-master » i686,client,el5,inkernel #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/tests/truncate.c
            • lustre/liblustre/super.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • lustre/tests/checkstat.c
            • lnet/utils/routerstat.c
            • lustre/include/lustre_debug.h
            • lustre/utils/gss/lgss_utils.c
            • lustre/llite/file.c
            • lustre/utils/gss/lgss_keyring.c
            • libcfs/include/libcfs/linux/kp30.h
            • lustre/fid/lproc_fid.c
            • lustre/llite/rw.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » i686,client,el5,inkernel #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/tests/truncate.c lustre/liblustre/super.c libcfs/include/libcfs/posix/posix-wordsize.h lustre/tests/checkstat.c lnet/utils/routerstat.c lustre/include/lustre_debug.h lustre/utils/gss/lgss_utils.c lustre/llite/file.c lustre/utils/gss/lgss_keyring.c libcfs/include/libcfs/linux/kp30.h lustre/fid/lproc_fid.c lustre/llite/rw.c

            Integrated in lustre-master » i686,client,el5,ofa #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lnet/utils/routerstat.c
            • libcfs/include/libcfs/linux/kp30.h
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • lustre/llite/file.c
            • lustre/llite/rw.c
            • lustre/liblustre/super.c
            • lustre/tests/checkstat.c
            • lustre/include/lustre_debug.h
            • lustre/utils/gss/lgss_utils.c
            • lustre/utils/gss/lgss_keyring.c
            • lustre/tests/truncate.c
            • lustre/fid/lproc_fid.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » i686,client,el5,ofa #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lnet/utils/routerstat.c libcfs/include/libcfs/linux/kp30.h libcfs/include/libcfs/posix/posix-wordsize.h lustre/llite/file.c lustre/llite/rw.c lustre/liblustre/super.c lustre/tests/checkstat.c lustre/include/lustre_debug.h lustre/utils/gss/lgss_utils.c lustre/utils/gss/lgss_keyring.c lustre/tests/truncate.c lustre/fid/lproc_fid.c

            Integrated in lustre-master » x86_64,server,el5,inkernel #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/tests/truncate.c
            • lustre/utils/gss/lgss_utils.c
            • lustre/llite/file.c
            • lustre/llite/rw.c
            • lustre/include/lustre_debug.h
            • lustre/fid/lproc_fid.c
            • lustre/utils/gss/lgss_keyring.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • libcfs/include/libcfs/linux/kp30.h
            • lustre/tests/checkstat.c
            • lustre/liblustre/super.c
            • lnet/utils/routerstat.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » x86_64,server,el5,inkernel #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/tests/truncate.c lustre/utils/gss/lgss_utils.c lustre/llite/file.c lustre/llite/rw.c lustre/include/lustre_debug.h lustre/fid/lproc_fid.c lustre/utils/gss/lgss_keyring.c libcfs/include/libcfs/posix/posix-wordsize.h libcfs/include/libcfs/linux/kp30.h lustre/tests/checkstat.c lustre/liblustre/super.c lnet/utils/routerstat.c

            Integrated in lustre-master » x86_64,client,ubuntu1004,inkernel #378
            LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624)

            Result = SUCCESS
            Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624
            Files :

            • lustre/liblustre/super.c
            • lnet/utils/routerstat.c
            • lustre/utils/gss/lgss_utils.c
            • lustre/tests/checkstat.c
            • lustre/llite/rw.c
            • lustre/tests/truncate.c
            • libcfs/include/libcfs/linux/kp30.h
            • lustre/include/lustre_debug.h
            • lustre/llite/file.c
            • lustre/fid/lproc_fid.c
            • libcfs/include/libcfs/posix/posix-wordsize.h
            • lustre/utils/gss/lgss_keyring.c
            hudson Build Master (Inactive) added a comment - Integrated in lustre-master » x86_64,client,ubuntu1004,inkernel #378 LU-871 build: change %L printk format to %ll (Revision 3684de257a7e8932936a27d0fdb3ecb39653e624) Result = SUCCESS Oleg Drokin : 3684de257a7e8932936a27d0fdb3ecb39653e624 Files : lustre/liblustre/super.c lnet/utils/routerstat.c lustre/utils/gss/lgss_utils.c lustre/tests/checkstat.c lustre/llite/rw.c lustre/tests/truncate.c libcfs/include/libcfs/linux/kp30.h lustre/include/lustre_debug.h lustre/llite/file.c lustre/fid/lproc_fid.c libcfs/include/libcfs/posix/posix-wordsize.h lustre/utils/gss/lgss_keyring.c

            People

              adilger Andreas Dilger
              adilger Andreas Dilger
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: