From fd7154167cdf6cb0ee2bb7edde77a947070cee03 Mon Sep 17 00:00:00 2001 From: kwantam Date: Thu, 9 Dec 2021 23:58:28 -0500 Subject: [PATCH 1/4] size_t is in cstddef in some stdlibs it's enough to include , but size_t is only guaranteed to be defined in cstddef. Concretely, this fixes build with gcc-11. --- libiop/algebra/utils.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libiop/algebra/utils.hpp b/libiop/algebra/utils.hpp index f25ed7ab..dd5024c3 100644 --- a/libiop/algebra/utils.hpp +++ b/libiop/algebra/utils.hpp @@ -8,6 +8,7 @@ #ifndef LIBIOP_ALGEBRA_UTILS_HPP_ #define LIBIOP_ALGEBRA_UTILS_HPP_ +#include #include #include From 0d3b77326e0834c8793d65ed25dc3a00202b0b92 Mon Sep 17 00:00:00 2001 From: kwantam Date: Thu, 9 Dec 2021 23:58:42 -0500 Subject: [PATCH 2/4] fix dummy_oracle::evaluated_contents This function reserves some number of entries in the result vector with the intent of adding that many entries. Instead, the for loop iterates over the *size* of results (which is zero---reserve doesn't change the size'!'). This causes evaluated_contents to return a zero-length vector, which eventually bubbles up and causes a segfault in fri_iop. --- libiop/protocols/encoded/dummy_protocol.tcc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libiop/protocols/encoded/dummy_protocol.tcc b/libiop/protocols/encoded/dummy_protocol.tcc index 1f9df2cd..3e3cd978 100644 --- a/libiop/protocols/encoded/dummy_protocol.tcc +++ b/libiop/protocols/encoded/dummy_protocol.tcc @@ -22,8 +22,9 @@ std::shared_ptr> dummy_oracle::evaluated_contents( } std::shared_ptr> result = std::make_shared>(); - result->reserve(constituent_oracle_evaluations[0]->size()); - for (size_t i = 0; i < result->size(); ++i) + const auto result_size = constituent_oracle_evaluations[0]->size(); + result->reserve(result_size); + for (size_t i = 0; i < result_size; ++i) { result->emplace_back(FieldT::zero()); } From de28c6aaa3a9053c1f43c692ed0d5b636488c589 Mon Sep 17 00:00:00 2001 From: kwantam Date: Thu, 9 Dec 2021 23:58:57 -0500 Subject: [PATCH 3/4] fix cli option parsing in FRI profiling executable --- libiop/profiling/instrument_fri_snark.cpp | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libiop/profiling/instrument_fri_snark.cpp b/libiop/profiling/instrument_fri_snark.cpp index 6821bed8..a7115ecb 100644 --- a/libiop/profiling/instrument_fri_snark.cpp +++ b/libiop/profiling/instrument_fri_snark.cpp @@ -29,11 +29,11 @@ #ifndef CPPDEBUG bool process_prover_command_line(const int argc, const char** argv, options &options, - std::size_t localization_parameter, - std::size_t num_localization_steps, - std::size_t num_oracles, - std::size_t num_interactive_repetitions, - std::size_t num_query_repetitions) + std::size_t *localization_parameter, + std::size_t *num_localization_steps, + std::size_t *num_oracles, + std::size_t *num_interactive_repetitions, + std::size_t *num_query_repetitions) { namespace po = boost::program_options; @@ -41,11 +41,11 @@ bool process_prover_command_line(const int argc, const char** argv, options &opt { po::options_description desc = gen_options(options); desc.add_options() - ("localization_parameter", po::value(&localization_parameter)->default_value(2), "Only used when num_localization_steps is 0") - ("num_localization_steps", po::value(&num_localization_steps)->default_value(0)) - ("num_oracles", po::value(&num_oracles)->default_value(1)) - ("num_interactive_repetitions", po::value(&num_interactive_repetitions)->default_value(1)) - ("num_query_repetitions", po::value(&num_query_repetitions)->default_value(64)); + ("localization_parameter", po::value(localization_parameter)->default_value(2), "Only used when num_localization_steps is 0") + ("num_localization_steps", po::value(num_localization_steps)->default_value(0)) + ("num_oracles", po::value(num_oracles)->default_value(1)) + ("num_interactive_repetitions", po::value(num_interactive_repetitions)->default_value(1)) + ("num_query_repetitions", po::value(num_query_repetitions)->default_value(64)); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -157,9 +157,9 @@ int main(int argc, const char * argv[]) libff::UNUSED(argv); #else - if (!process_prover_command_line(argc, argv, default_vals, localization_parameter, - num_interactive_repetitions, num_query_repetitions, - num_localization_steps, num_oracles)) + if (!process_prover_command_line(argc, argv, default_vals, &localization_parameter, + &num_interactive_repetitions, &num_query_repetitions, + &num_localization_steps, &num_oracles)) { return 1; } From 49bbb1e30c8703dcbe7cc961bcd8e3a6c8ccf83c Mon Sep 17 00:00:00 2001 From: kwantam Date: Fri, 10 Dec 2021 00:49:06 -0500 Subject: [PATCH 4/4] update benchmark to upstream head there seems to be an issue with the old benchmark version with new compilers. the new version seems to work fine, though. --- depends/benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/benchmark b/depends/benchmark index a9beffda..e991355c 160000 --- a/depends/benchmark +++ b/depends/benchmark @@ -1 +1 @@ -Subproject commit a9beffda0b89a6995372100456a4ad894d29b93b +Subproject commit e991355c02b93fe17713efe04cbc2e278e00fdbd