Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No public description #1552

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions centipede/centipede_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ static std::vector<ByteArray> RunWithFunctionFilter(
env.symbolizer_path = GetLLVMSymbolizerPath();
env.objdump_path = GetObjDumpPath();
env.log_level = 0;
env.populate_binary_info = true;
env.function_filter = function_filter;
FunctionFilterMock mock(env);
MockFactory factory(mock);
Expand Down
2 changes: 1 addition & 1 deletion centipede/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct Environment {
#endif
bool dry_run = false;
bool save_binary_info = false;
bool populate_binary_info = true;
bool populate_binary_info = false;
#ifdef CENTIPEDE_DISABLE_RIEGELI
bool riegeli = false;
#else
Expand Down
11 changes: 6 additions & 5 deletions centipede/environment_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,12 @@ ABSL_FLAG(bool, dry_run, Environment::Default().dry_run,
ABSL_FLAG(bool, save_binary_info, Environment::Default().save_binary_info,
"Save the BinaryInfo from the fuzzing run within the working "
"directory.");
ABSL_FLAG(bool, populate_binary_info,
Environment::Default().populate_binary_info,
"Get binary info from a coverage instrumented binary. This should "
"only be turned off when coverage is not based on instrumenting some "
"binary.");
ABSL_FLAG(
bool, populate_binary_info, Environment::Default().populate_binary_info,
"If set, get binary info from a coverage-instrumented binary specified in "
"--coverage_binary, or --binary in case the former is unset. This is "
"needed for --analyze, --function_filter, --log_features_shards, and "
"--use_pcpair_features.");
#ifndef CENTIPEDE_DISABLE_RIEGELI
ABSL_FLAG(bool, riegeli, Environment::Default().riegeli,
"Use Riegeli file format (instead of the legacy bespoke encoding) "
Expand Down
11 changes: 6 additions & 5 deletions centipede/testing/centipede_main_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test_debug_symbols() {

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

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

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

Expand Down
Loading