[
https://issues.apache.org/jira/browse/HADOOP-18491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615746#comment-17615746
]
FuzzingTeam commented on HADOOP-18491:
--------------------------------------
Unlike the other input parameter *chunkSizeKB* of the same method, there is no
direct/indirect check for negative values of {*}dataSizeMB{*}.
*Code section of current configure method implementation*
{code:java}
public static void configure(int dataSizeMB, int chunkSizeKB) {
chunkSize = chunkSizeKB * 1024;
// buffer size needs to be a multiple of (numDataUnits * chunkSize)
int round = (int) Math.round(
TARGET_BUFFER_SIZE_MB * 1024.0 / NUM_DATA_UNITS / chunkSizeKB);
Preconditions.checkArgument(round > 0);
bufferSizeKB = NUM_DATA_UNITS * chunkSizeKB * round;
System.out.println("Using " + bufferSizeKB / 1024 + "MB buffer.");
round = (int) Math.round(
(dataSizeMB * 1024.0) / bufferSizeKB);
if (round == 0) {
round = 1;
}
totalDataSizeKB = round * bufferSizeKB;
} {code}
**
{*}Solution{*}:-
*We propose adding an argument check for* {*}dataSizeMB{*}{*}, which handles
negative values by throwing an IllegalArgumentException, just like it is done
for{*} {*}chunkSizeKB.{*}{*}{*}
> RawErasureCoderBenchmark.configure() returns negative values of data and
> throughput in the output
> -------------------------------------------------------------------------------------------------
>
> Key: HADOOP-18491
> URL: https://issues.apache.org/jira/browse/HADOOP-18491
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 3.3.4
> Reporter: FuzzingTeam
> Priority: Major
> Labels: pull-request-available
>
> The method _configure_ of class BenchData inside
> RawErasureCoderBenchmark.java, when provided with a negative value for its
> input parameter ({_}int dataSizeMB{_}) returns negative values of data and
> throughput instead of logging an error or throwing an exception.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]