Skip to content

Commit 6f9429a

Browse files
xinhaoyuancopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 723328993
1 parent 5378a1a commit 6f9429a

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

centipede/centipede_test.cc

+1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ static std::vector<ByteArray> RunWithFunctionFilter(
589589
env.symbolizer_path = GetLLVMSymbolizerPath();
590590
env.objdump_path = GetObjDumpPath();
591591
env.log_level = 0;
592+
env.populate_binary_info = true;
592593
env.function_filter = function_filter;
593594
FunctionFilterMock mock(env);
594595
MockFactory factory(mock);

centipede/environment.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct Environment {
114114
#endif
115115
bool dry_run = false;
116116
bool save_binary_info = false;
117-
bool populate_binary_info = true;
117+
bool populate_binary_info = false;
118118
#ifdef CENTIPEDE_DISABLE_RIEGELI
119119
bool riegeli = false;
120120
#else

centipede/environment_flags.cc

+6-5
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ ABSL_FLAG(bool, dry_run, Environment::Default().dry_run,
395395
ABSL_FLAG(bool, save_binary_info, Environment::Default().save_binary_info,
396396
"Save the BinaryInfo from the fuzzing run within the working "
397397
"directory.");
398-
ABSL_FLAG(bool, populate_binary_info,
399-
Environment::Default().populate_binary_info,
400-
"Get binary info from a coverage instrumented binary. This should "
401-
"only be turned off when coverage is not based on instrumenting some "
402-
"binary.");
398+
ABSL_FLAG(
399+
bool, populate_binary_info, Environment::Default().populate_binary_info,
400+
"If set, get binary info from a coverage-instrumented binary specified in "
401+
"--coverage_binary, or --binary in case the former is unset. This is "
402+
"needed for --analyze, --function_filter, --log_features_shards, and "
403+
"--use_pcpair_features.");
403404
#ifndef CENTIPEDE_DISABLE_RIEGELI
404405
ABSL_FLAG(bool, riegeli, Environment::Default().riegeli,
405406
"Use Riegeli file format (instead of the legacy bespoke encoding) "

centipede/testing/centipede_main_test.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test_debug_symbols() {
6868

6969
echo "============ ${FUNC}: run for the first time, with empty seed corpus, with feature logging"
7070
test_fuzz --log_features_shards=1 --workdir="${WD}" --seed=1 --num_runs=1000 \
71-
--symbolizer_path="${LLVM_SYMBOLIZER}" | tee "${LOG}"
71+
--populate_binary_info=true --symbolizer_path="${LLVM_SYMBOLIZER}" | tee "${LOG}"
7272
centipede::assert_regex_in_file 'Custom mutator detected: will use it' "${LOG}"
7373
# Note: the test assumes LLVMFuzzerTestOneInput is defined on a specific line.
7474
centipede::assert_regex_in_file "FUNC: LLVMFuzzerTestOneInput .*testing/test_fuzz_target.cc:71" "${LOG}"
@@ -81,7 +81,8 @@ test_debug_symbols() {
8181
# TODO(b/282845630): Passing `--num_runs=1` only to trigger telemetry dumping.
8282
# Change to `--num_runs=0` after the bug is fixed.
8383
test_fuzz --log_features_shards=1 --workdir="${WD}" --seed=1 --num_runs=1 \
84-
--telemetry_frequency=1 --symbolizer_path="${LLVM_SYMBOLIZER}" 2>&1 \
84+
--telemetry_frequency=1 --populate_binary_info=true \
85+
--symbolizer_path="${LLVM_SYMBOLIZER}" 2>&1 \
8586
| tee -a "${LOG}"
8687
centipede::assert_regex_in_file "FUNC: SingleEdgeFunc" "${LOG}"
8788
centipede::assert_regex_in_file "FUNC: MultiEdgeFunc" "${LOG}"
@@ -98,7 +99,7 @@ test_debug_symbols() {
9899
echo "============ ${FUNC}: run w/o the symbolizer, everything else should still work."
99100
centipede::ensure_empty_dir "${WD}"
100101
test_fuzz --workdir="${WD}" --seed=1 --num_runs=1000 \
101-
--symbolizer_path=/dev/null | tee "${LOG}"
102+
--populate_binary_info=true --symbolizer_path=/dev/null | tee "${LOG}"
102103
centipede::assert_regex_in_file "Symbolizer unspecified: debug symbols will not be used" "${LOG}"
103104
centipede::assert_regex_in_file "end-fuzz:" "${LOG}"
104105
}
@@ -167,12 +168,12 @@ test_pcpair_features() {
167168

168169
echo "============ ${FUNC}: fuzz with --use_pcpair_features"
169170
test_fuzz --workdir="${WD}" --use_pcpair_features --num_runs=10000 \
170-
--symbolizer_path="${LLVM_SYMBOLIZER}" | tee "${LOG}"
171+
--populate_binary_info=true --symbolizer_path="${LLVM_SYMBOLIZER}" | tee "${LOG}"
171172
centipede::assert_regex_in_file "end-fuzz.*pair: [^0]" "${LOG}"
172173

173174
echo "============ ${FUNC}: fuzz with --use_pcpair_features w/o symbolizer"
174175
test_fuzz --workdir="${WD}" --use_pcpair_features --num_runs=10000 \
175-
--symbolizer_path=/dev/null | tee "${LOG}"
176+
--populate_binary_info=true --symbolizer_path=/dev/null | tee "${LOG}"
176177
centipede::assert_regex_in_file "end-fuzz.*pair: [^0]" "${LOG}"
177178
}
178179

0 commit comments

Comments
 (0)