Hadoop Common
  1. Hadoop Common
  2. HADOOP-6926

SocketInputStream incorrectly implements read()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.2, 0.21.0, 0.22.0
    • Fix Version/s: 0.22.0
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      SocketInputStream's read() implementation doesn't upcast to int correctly, so it can't read bytes > 0x80. This is the same bug as HADOOP-6925, but in a different spot.

      1. HADOOP-6926.patch
        1 kB
        Tom White
      2. hadoop-6926.txt
        1 kB
        Todd Lipcon

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk #504 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/504/)
        HADOOP-6926. SocketInputStream incorrectly implements read(). Contributed by Todd Lipcon.

        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk #504 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk/504/ ) HADOOP-6926 . SocketInputStream incorrectly implements read(). Contributed by Todd Lipcon.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #417 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/417/)
        HADOOP-6926. SocketInputStream incorrectly implements read(). Contributed by Todd Lipcon.

        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #417 (See https://hudson.apache.org/hudson/job/Hadoop-Common-trunk-Commit/417/ ) HADOOP-6926 . SocketInputStream incorrectly implements read(). Contributed by Todd Lipcon.
        Hide
        Tom White added a comment -

        I've just committed this. Thanks Todd!

        Show
        Tom White added a comment - I've just committed this. Thanks Todd!
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12458969/HADOOP-6926.patch
        against trunk revision 1031743.

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

        +1 tests included. The patch appears to include 3 new or modified tests.

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

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

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

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

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

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

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//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/12458969/HADOOP-6926.patch against trunk revision 1031743. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/78//console This message is automatically generated.
        Hide
        Tom White added a comment -

        +1

        The javac compilation error was due to:

        <     [javac] /Users/tom/workspace/hadoop-common-trunk/src/test/core/org/apache/hadoop/net/TestSocketIOWithTimeout.java:112: warning: [cast] redundant cast to int
        <     [javac]       assertEquals((int)(byteWithHighBit & 0xff), in.read());
        

        Here's a new patch with the cast removed.

        Show
        Tom White added a comment - +1 The javac compilation error was due to: < [javac] /Users/tom/workspace/hadoop-common-trunk/src/test/core/org/apache/hadoop/net/TestSocketIOWithTimeout.java:112: warning: [cast] redundant cast to int < [javac] assertEquals((int)(byteWithHighBit & 0xff), in.read()); Here's a new patch with the cast removed.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12452982/hadoop-6926.txt
        against trunk revision 1031422.

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

        +1 tests included. The patch appears to include 3 new or modified tests.

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

        -1 javac. The applied patch generated 1049 javac compiler warnings (more than the trunk's current 1048 warnings).

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

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

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

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

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//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/12452982/hadoop-6926.txt against trunk revision 1031422. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. -1 javac. The applied patch generated 1049 javac compiler warnings (more than the trunk's current 1048 warnings). +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/20//console This message is automatically generated.
        Hide
        Todd Lipcon added a comment -

        Ran unit tests locally. All passed except for TestListFiles (fixed by HADOOP-6933).

        Show
        Todd Lipcon added a comment - Ran unit tests locally. All passed except for TestListFiles (fixed by HADOOP-6933 ).

          People

          • Assignee:
            Todd Lipcon
            Reporter:
            Todd Lipcon
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development