Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 2.0.2-alpha
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Fix some compiler warnings. Some of these are misuses of fprintf (forgetting the FILE* parameter), const mismatch warnings, format specifier warnings.

      1. HDFS-3673.003.patch
        5 kB
        Colin Patrick McCabe
      2. HDFS-3673.002.patch
        5 kB
        Colin Patrick McCabe
      3. HDFS-3673.001.patch
        5 kB
        Colin Patrick McCabe

        Activity

        Colin Patrick McCabe created issue -
        Colin Patrick McCabe made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Colin Patrick McCabe made changes -
        Project Hadoop Common [ 12310240 ] Hadoop HDFS [ 12310942 ]
        Key HADOOP-8600 HDFS-3673
        Affects Version/s 2.1.0-alpha [ 12321440 ]
        Affects Version/s 2.1.0-alpha [ 12321441 ]
        Target Version/s 2.1.0-alpha [ 12321441 ] 2.1.0-alpha [ 12321440 ]
        Hide
        Colin Patrick McCabe added a comment -
        • fix bad calls to fprintf
        • fix bad format strings
        • fix const warnings
        • move hdfsDisableDirectRead into hdfs_test.h (it's not intended for library consumers, just testing)
        • test_libhdfs_read: remove unused variable
        • test_libhdfs_threaded: need to include string.h
        Show
        Colin Patrick McCabe added a comment - fix bad calls to fprintf fix bad format strings fix const warnings move hdfsDisableDirectRead into hdfs_test.h (it's not intended for library consumers, just testing) test_libhdfs_read: remove unused variable test_libhdfs_threaded: need to include string.h
        Colin Patrick McCabe made changes -
        Attachment HDFS-3673.001.patch [ 12536731 ]
        Hide
        Andy Isaacson added a comment -
        -    if (fs == NULL) {
        +    if (jFS == NULL) {
        ...
        -    (*env)->DeleteGlobalRef(env, fs);
        +    (*env)->DeleteGlobalRef(env, jFS);
        

        This change isn't described in your comment, and doesn't appear to be an improvement. Please revert.

        +        fprintf(stderr, "getJNIEnv: OOM allocating %Zd bytes\n",
        

        printf(3) says we should use z instead of Z:

               z      A following integer conversion corresponds to a size_t or ssize_t argument.
                      (Linux libc5 has Z with this meaning.  Don't use it.)
        
        -            fprintf("pthread_key_create failed with error %d\n", ret);
        +            fprintf(stderr, "pthread_key_create failed with error %d\n", ret);
        

        Should probably include the function name, or maybe _FILE LINE_, in the error message.

        Show
        Andy Isaacson added a comment - - if (fs == NULL) { + if (jFS == NULL) { ... - (*env)->DeleteGlobalRef(env, fs); + (*env)->DeleteGlobalRef(env, jFS); This change isn't described in your comment, and doesn't appear to be an improvement. Please revert. + fprintf(stderr, "getJNIEnv: OOM allocating %Zd bytes\n" , printf(3) says we should use z instead of Z: z A following integer conversion corresponds to a size_t or ssize_t argument. (Linux libc5 has Z with this meaning. Don't use it.) - fprintf( "pthread_key_create failed with error %d\n" , ret); + fprintf(stderr, "pthread_key_create failed with error %d\n" , ret); Should probably include the function name, or maybe _ FILE LINE _ , in the error message.
        Hide
        Colin Patrick McCabe added a comment -

        [fs to jFS change]

        Using fs in this context generates a type mismatch warning. This is one of those cases where we do a type conversion from the publicly exposed (opaque) datatype to the "real" datatype, in this case simply a JNI pointer. We don't want to expose the jobject pointer to the library user, hence the typecasts.

        [use z instead of Z]

        Good catch.

        Show
        Colin Patrick McCabe added a comment - [fs to jFS change] Using fs in this context generates a type mismatch warning. This is one of those cases where we do a type conversion from the publicly exposed (opaque) datatype to the "real" datatype, in this case simply a JNI pointer. We don't want to expose the jobject pointer to the library user, hence the typecasts. [use z instead of Z] Good catch.
        Colin Patrick McCabe made changes -
        Attachment HDFS-3673.002.patch [ 12536737 ]
        Hide
        Andy Isaacson added a comment -

        Using fs in this context generates a type mismatch warning.

        Ah, DeleteGlobalRef takes a jobject not a void *. OK, then changing that one is good, but please preserve the NULL test as using fs not jFS.

        Show
        Andy Isaacson added a comment - Using fs in this context generates a type mismatch warning. Ah, DeleteGlobalRef takes a jobject not a void * . OK, then changing that one is good, but please preserve the NULL test as using fs not jFS .
        Hide
        Colin Patrick McCabe added a comment -
        • test fs rather than jFS
        Show
        Colin Patrick McCabe added a comment - test fs rather than jFS
        Colin Patrick McCabe made changes -
        Attachment HDFS-3673.003.patch [ 12536744 ]
        Colin Patrick McCabe made changes -
        Status In Progress [ 3 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12536744/HDFS-3673.003.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 2 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

        org.apache.hadoop.hdfs.server.blockmanagement.TestBlocksWithNotEnoughRacks
        org.apache.hadoop.hdfs.server.namenode.TestListCorruptFileBlocks
        org.apache.hadoop.hdfs.TestDFSClientRetries

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2840//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2840//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12536744/HDFS-3673.003.patch against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 2 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.server.blockmanagement.TestBlocksWithNotEnoughRacks org.apache.hadoop.hdfs.server.namenode.TestListCorruptFileBlocks org.apache.hadoop.hdfs.TestDFSClientRetries +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2840//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2840//console This message is automatically generated.
        Hide
        Andy Isaacson added a comment -

        +1 thanks for cleaning it up! This looks great.

        Show
        Andy Isaacson added a comment - +1 thanks for cleaning it up! This looks great.
        Hide
        Eli Collins added a comment -

        +1 lgtm as well

        Show
        Eli Collins added a comment - +1 lgtm as well
        Hide
        Eli Collins added a comment -

        I've committed this and merged to branch-2.

        Show
        Eli Collins added a comment - I've committed this and merged to branch-2.
        Eli Collins made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Target Version/s 2.1.0-alpha [ 12321440 ]
        Fix Version/s 2.2.0-alpha [ 12322472 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2566 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2566/)
        HDFS-3673. libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457)

        Result = SUCCESS
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2566 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2566/ ) HDFS-3673 . libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #2501 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2501/)
        HDFS-3673. libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457)

        Result = SUCCESS
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2501 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2501/ ) HDFS-3673 . libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2523 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2523/)
        HDFS-3673. libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457)

        Result = FAILURE
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2523 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2523/ ) HDFS-3673 . libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457) Result = FAILURE eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1142 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1142/)
        HDFS-3673. libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457)

        Result = FAILURE
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1142 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1142/ ) HDFS-3673 . libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe (Revision 1363457) Result = FAILURE eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1363457 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
        Arun C Murthy made changes -
        Affects Version/s 2.0.0-alpha [ 12320353 ]
        Affects Version/s 2.1.0-alpha [ 12321440 ]
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        10m 45s 1 Colin Patrick McCabe 16/Jul/12 22:31
        In Progress In Progress Patch Available Patch Available
        8h 49m 1 Colin Patrick McCabe 17/Jul/12 07:20
        Patch Available Patch Available Resolved Resolved
        2d 12h 2m 1 Eli Collins 19/Jul/12 19:23
        Resolved Resolved Closed Closed
        83d 23h 22m 1 Arun C Murthy 11/Oct/12 18:46

          People

          • Assignee:
            Colin Patrick McCabe
            Reporter:
            Colin Patrick McCabe
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development