Skip to content
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
20 changes: 9 additions & 11 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ RUNNER_LINKOPTS = [
RUNNER_DEPS = [
":byte_array_mutator",
":callstack",
":dispatcher_flag_helper",
":execution_metadata",
":feature",
":foreach_nonzero",
Expand Down Expand Up @@ -1208,15 +1207,6 @@ cc_library(
],
)

cc_library(
name = "dispatcher_flag_helper",
hdrs = ["dispatcher_flag_helper.h"],
copts = DISABLE_SANCOV_COPTS,
deps = [
"@abseil-cpp//absl/base:nullability",
],
)

cc_library(
name = "sancov_runtime",
srcs = [
Expand All @@ -1238,7 +1228,6 @@ cc_library(
copts = DISABLE_SANCOV_COPTS,
deps = [
":callstack",
":dispatcher_flag_helper",
":engine_abi",
":execution_metadata",
":feature",
Expand Down Expand Up @@ -1730,6 +1719,15 @@ cc_test(
],
)

cc_test(
name = "runner_utils_test",
srcs = ["runner_utils_test.cc"],
deps = [
":runner_utils",
"@googletest//:gtest_main",
],
)

cc_binary(
name = "command_test_helper",
srcs = ["command_test_helper.cc"],
Expand Down
8 changes: 5 additions & 3 deletions centipede/binary_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ void BinaryInfo::InitializeFromSanCovBinary(
std::filesystem::path{tmp_dir_path} / "binary_info_log_tmp";
FUZZTEST_LOG(INFO) << __func__ << ": tmp_dir: " << tmp_dir;

env_diff.push_back(absl::StrCat(
"CENTIPEDE_RUNNER_FLAGS=:dump_binary_info:arg1=", pc_table_path.path(),
":arg2=", cf_table_path.path(), ":arg3=", dso_table_path.path(), ":"));
env_diff.push_back(
absl::StrCat("CENTIPEDE_RUNNER_FLAGS=:dump_binary_info:arg1=",
EngineFlagEscape(pc_table_path.path()),
":arg2=", EngineFlagEscape(cf_table_path.path()),
":arg3=", EngineFlagEscape(dso_table_path.path()), ":"));
Command::Options cmd_options;
cmd_options.env_diff = std::move(env_diff);
cmd_options.stdout_file_prefix = log_prefix;
Expand Down
43 changes: 25 additions & 18 deletions centipede/centipede_callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,12 @@ std::string CentipedeCallbacks::ConstructRunnerFlags(
if (env_.use_dataflow_features) flags.emplace_back("use_dataflow_features");
}
if (!env_.runner_dl_path_suffix.empty()) {
flags.emplace_back(
absl::StrCat("dl_path_suffix=", env_.runner_dl_path_suffix));
flags.emplace_back(absl::StrCat(
"dl_path_suffix=", EngineFlagEscape(env_.runner_dl_path_suffix)));
}
if (!env_.pcs_file_path.empty())
flags.emplace_back(absl::StrCat("pcs_file_path=", env_.pcs_file_path));
flags.emplace_back(
absl::StrCat("pcs_file_path=", EngineFlagEscape(env_.pcs_file_path)));
if (!extra_flags.empty()) flags.emplace_back(extra_flags);
flags.emplace_back("");
return absl::StrJoin(flags, ":");
Expand Down Expand Up @@ -399,15 +400,20 @@ CentipedeCallbacks::GetOrCreateCommandContextForBinary(
}
std::vector<std::string> env_diff = env_.env_diff_for_binaries;
env_diff.push_back(ConstructRunnerFlags(
absl::StrCat(":shmem:test=", env_.test_name, ":arg1=",
inputs_blobseq_.path(), ":arg2=", outputs_blobseq_.path(),
":failure_description_path=", failure_description_path_,
":failure_signature_path=", failure_signature_path_,
persistent_mode_server == nullptr
? ""
: absl::StrCat(":persistent_mode_socket=",
persistent_mode_server->server_path()),
":"),
absl::StrCat(
":shmem_size_mb=", env_.shmem_size_mb,
":test=", EngineFlagEscape(env_.test_name),
":arg1=", EngineFlagEscape(inputs_blobseq_.path()),
":arg2=", EngineFlagEscape(outputs_blobseq_.path()),
":failure_description_path=",
EngineFlagEscape(failure_description_path_),
":failure_signature_path=", EngineFlagEscape(failure_signature_path_),
persistent_mode_server == nullptr
? ""
: absl::StrCat(
":persistent_mode_socket=",
EngineFlagEscape(persistent_mode_server->server_path())),
":"),
disable_coverage));

if (env_.clang_coverage_binary == binary) {
Expand Down Expand Up @@ -648,9 +654,10 @@ bool CentipedeCallbacks::GetSeedsViaExternalBinary(
FUZZTEST_CHECK(!error) << "Failed to create seed inputs directory "
<< output_dir << ": " << error.message();

std::string centipede_runner_flags = absl::StrCat(
"CENTIPEDE_RUNNER_FLAGS=:dump_seed_inputs:test=", env_.test_name,
":arg1=", output_dir.string(), ":");
std::string centipede_runner_flags =
absl::StrCat("CENTIPEDE_RUNNER_FLAGS=:dump_seed_inputs:test=",
EngineFlagEscape(env_.test_name),
":arg1=", EngineFlagEscape(output_dir.string()), ":");
if (!env_.runner_dl_path_suffix.empty()) {
absl::StrAppend(&centipede_runner_flags,
"dl_path_suffix=", env_.runner_dl_path_suffix, ":");
Expand Down Expand Up @@ -716,10 +723,10 @@ bool CentipedeCallbacks::GetSerializedTargetConfigViaExternalBinary(
std::filesystem::path{temp_dir_} / "configuration";
std::string centipede_runner_flags =
absl::StrCat("CENTIPEDE_RUNNER_FLAGS=:dump_configuration:arg1=",
config_file_path.string(), ":");
EngineFlagEscape(config_file_path.string()), ":");
if (!env_.runner_dl_path_suffix.empty()) {
absl::StrAppend(&centipede_runner_flags,
"dl_path_suffix=", env_.runner_dl_path_suffix, ":");
absl::StrAppend(&centipede_runner_flags, "dl_path_suffix=",
EngineFlagEscape(env_.runner_dl_path_suffix), ":");
}
Command::Options cmd_options;
cmd_options.env_diff = env_.env_diff_for_binaries;
Expand Down
76 changes: 0 additions & 76 deletions centipede/dispatcher_flag_helper.h

This file was deleted.

Loading
Loading