[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18041407#comment-18041407
 ] 

ASF GitHub Bot commented on MAPREDUCE-7346:
-------------------------------------------

github-actions[bot] commented on PR #3047:
URL: https://github.com/apache/hadoop/pull/3047#issuecomment-3590739496

   We're closing this stale PR because it has been open for 100 days with no 
activity. This isn't a judgement on the merit of the PR in any way. It's just a 
way of keeping the PR queue manageable.
   If you feel like this was a mistake, or you would like to continue working 
on it, please feel free to re-open it and ask for a committer to remove the 
stale tag and review again.
   Thanks all for your contribution.




> [Gridmix] A potential divide by zero in AvgRecordFactory
> --------------------------------------------------------
>
>                 Key: MAPREDUCE-7346
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7346
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: contrib/gridmix
>            Reporter: Yiyuan GUO
>            Priority: Major
>              Labels: gridmix, pull-request-available, security
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In the file _gridmix/AvgRecordFactory.java,_ one of the class's constructor 
> has the following 
> [code|https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/AvgRecordFactory.java#L63-#L68]:
> {code:java}
> public AvgRecordFactory(long targetBytes, long targetRecords,
>       Configuration conf, int minSpilledBytes) {
>     this.targetBytes = targetBytes;
>     this.targetRecords = targetRecords <= 0 && this.targetBytes >= 0
>       ? Math.max(1,
>           this.targetBytes / conf.getInt(GRIDMIX_MISSING_REC_SIZE, 64 * 1024))
>       : targetRecords;
>     final long tmp = this.targetBytes / this.targetRecords;
>     ...
> }
> {code}
> The check in the code _targetRecords <= 0 && this.targetBytes >= 0_ is not 
> sufficient: when _*targetRecords == 0 && targetBytes < 0*,_ we can bypass the 
> protection checking and set _this.targetRecords_ to zero, leading to a divide 
> by zero problem when computing _tmp._
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to