[ 
https://issues.apache.org/jira/browse/HAWQ-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ruilong Huo reassigned HAWQ-263:
--------------------------------

    Assignee: Ruilong Huo  (was: Lei Chang)

> Fix "Wrong sizeof argument (SIZEOF_MISMATCH)" issue in MoveOutCGroupForQE 
> found by Coverity
> -------------------------------------------------------------------------------------------
>
>                 Key: HAWQ-263
>                 URL: https://issues.apache.org/jira/browse/HAWQ-263
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Resource Manager
>    Affects Versions: 2.0.0-beta-incubating
>            Reporter: Ruilong Huo
>            Assignee: Ruilong Huo
>
> Per Covertiy scan, there is "Wrong sizeof argument (SIZEOF_MISMATCH)" issue 
> in MoveOutCGroupForQE in resource enforcement.
> {noformat}
>  82/**
>  83 * Move the QE PID out of corresponding CGroup
>  84 */
>  85int
>  86MoveOutCGroupForQE(TimestampTz masterStartTime,
>  87                                   int connId,
>  88                                   int segId,
>  89                                   int procId,
>  90                                   char *errorbuf,
>  91                                   int errorbufsize)
>  92{
>  93#ifdef __linux
>  94        initializeQE2RMSEGComm();
>  95
>  96        int                     res                     = FUNC_RETURN_OK;
>  97
>  98        char            *serverHost     = "127.0.0.1";
>  99        uint16_t        serverPort      = rm_segment_port;
> 100
> 101        SelfMaintainBuffer sendBuffer = 
> createSelfMaintainBuffer(CurrentMemoryContext);
> 102        SelfMaintainBuffer recvBuffer = 
> createSelfMaintainBuffer(CurrentMemoryContext);
> 103
> 104        /* Build request */
> 105        RPCRequestMoveOutCGroupData request;
> 106        request.MasterStartTime = masterStartTime;
> 107        request.ConnID          = connId;
> 108        request.SegmentID               = segId;
> 109        request.ProcID                  = procId;
> 110        appendSMBVar(sendBuffer, request);
> 111
> 112        /* Send request */
>       
> CID 16865 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)
> suspicious_sizeof: Passing argument serverHost of type char * and argument 8 
> /* sizeof (errorbuf) */ to function callSyncRPCRemote is suspicious.
> 113        res = callSyncRPCRemote(serverHost,
> 114                                serverPort,
> 115                                sendBuffer->Buffer,
> 116                                sendBuffer->Cursor+1,
> 117                                REQUEST_QE_MOVEOUTCGROUP,
> 118                                RESPONSE_QE_MOVEOUTCGROUP,
> 119                                recvBuffer,
> 120                                                        errorbuf,
> 121                                                        sizeof(errorbuf));
> 122
> 123        deleteSelfMaintainBuffer(sendBuffer);
> 124        deleteSelfMaintainBuffer(recvBuffer);
> 125        return res;
> 126#endif
> 127        return FUNC_RETURN_OK;
> 128}
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to