Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5748

Potential null pointer deference in ShuffleHandler#Shuffle#messageReceived()

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Starting around line 510:

            ChannelFuture lastMap = null;
            for (String mapId : mapIds) {
      ...
            }
            lastMap.addListener(metrics);
            lastMap.addListener(ChannelFutureListener.CLOSE);
      

      If mapIds is empty, lastMap would remain null, leading to NPE in addListener() call.

        Activity

        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12635637/0001-MAPREDUCE-5748-Potential-null-pointer-deference-in-S.patch
        against trunk revision .

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

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

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

        +1 javadoc. There were no new javadoc 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 passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle.

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

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4451//testReport/
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4451//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/12635637/0001-MAPREDUCE-5748-Potential-null-pointer-deference-in-S.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc 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 passed unit tests in hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4451//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/4451//console This message is automatically generated.
        Hide
        Ted Yu added a comment -

        +1 if tests pass.

        Thanks

        Show
        Ted Yu added a comment - +1 if tests pass. Thanks
        Hide
        Hussein Baghdadi added a comment -

        I tried to fix it. Kindly check the attached patched file.

        Show
        Hussein Baghdadi added a comment - I tried to fix it. Kindly check the attached patched file.
        Hide
        Hussein Baghdadi added a comment -

        Ok, sorry. My fault. You are right.

        Show
        Hussein Baghdadi added a comment - Ok, sorry. My fault. You are right.
        Hide
        Hussein Baghdadi added a comment -

        mapIds is already checked for null values:

        // line 472
        [code]
        if (mapIds == null || reduceQ == null || jobQ == null)

        { sendError(ctx, "Required param job, map and reduce", BAD_REQUEST); return; }

        [/code]

        Show
        Hussein Baghdadi added a comment - mapIds is already checked for null values: // line 472 [code] if (mapIds == null || reduceQ == null || jobQ == null) { sendError(ctx, "Required param job, map and reduce", BAD_REQUEST); return; } [/code]

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Development