Skip to content

Commit 0b0f8f9

Browse files
committed
Address review comments
1 parent 2b7bdb5 commit 0b0f8f9

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

cpp/src/arrow/ipc/file_fuzz.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424

2525
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
2626
auto status = arrow::ipc::internal::FuzzIpcFile(data, static_cast<int64_t>(size));
27-
arrow::internal::NoteFuzzStatus(status, data, static_cast<int64_t>(size));
27+
arrow::internal::LogFuzzStatus(status, data, static_cast<int64_t>(size));
2828
return 0;
2929
}

cpp/src/arrow/ipc/stream_fuzz.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424

2525
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
2626
auto status = arrow::ipc::internal::FuzzIpcStream(data, static_cast<int64_t>(size));
27-
arrow::internal::NoteFuzzStatus(status, data, static_cast<int64_t>(size));
27+
arrow::internal::LogFuzzStatus(status, data, static_cast<int64_t>(size));
2828
return 0;
2929
}

cpp/src/arrow/memory_pool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ class ARROW_EXPORT CappedMemoryPool : public MemoryPool {
310310
}
311311

312312
MemoryPool* wrapped_;
313-
int64_t bytes_allocated_limit_;
313+
const int64_t bytes_allocated_limit_;
314314
};
315315

316316
/// \brief Return a process-wide memory pool based on the system allocator.

cpp/src/arrow/util/fuzz_internal.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ MemoryPool* fuzzing_memory_pool() {
2929
return pool.get();
3030
}
3131

32-
void NoteFuzzStatus(const Status& st, const uint8_t* data, int64_t size) {
32+
void LogFuzzStatus(const Status& st, const uint8_t* data, int64_t size) {
33+
// Most fuzz inputs will be invalid and generate errors, only log potential OOMs
3334
if (st.IsOutOfMemory()) {
3435
ARROW_LOG(WARNING) << "Fuzzing input with size=" << size
3536
<< " hit allocation failure: " << st.ToString();

cpp/src/arrow/util/fuzz_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ constexpr int64_t kFuzzingMemoryLimit = 2200LL * 1000 * 1000;
3232
ARROW_EXPORT MemoryPool* fuzzing_memory_pool();
3333

3434
// Optionally log the outcome of fuzzing an input
35-
ARROW_EXPORT void NoteFuzzStatus(const Status&, const uint8_t* data, int64_t size);
35+
ARROW_EXPORT void LogFuzzStatus(const Status&, const uint8_t* data, int64_t size);
3636

3737
} // namespace arrow::internal

cpp/src/parquet/arrow/fuzz.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
2323
auto status = parquet::arrow::internal::FuzzReader(data, static_cast<int64_t>(size));
24-
arrow::internal::NoteFuzzStatus(status, data, static_cast<int64_t>(size));
24+
arrow::internal::LogFuzzStatus(status, data, static_cast<int64_t>(size));
2525
return 0;
2626
}

0 commit comments

Comments
 (0)