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

[test] Transition some benchmarks over to take advantage of envoy_cc_benchmark_binary and envoy_benchmark_test #10409

Merged

Conversation

antoniovicente
Copy link
Contributor

@antoniovicente antoniovicente commented Mar 16, 2020

Description: Transition some benchmarks over to take advantage of envoy_cc_benchmark_binary and envoy_benchmark_test. This first round only covers benchmarks that do not require large refactors or code fixes in order to use the new framework.
Risk Level: n/a
Testing: test-only
Docs Changes: n/a
Release Notes: n/a
Fixes #9541 #9540 #9539

…rk_binary and envoy_benchmark_test

This first round only covers benchmarks that do not require large refactors or code fixes in order to use the new framework.

Signed-off-by: Antonio Vicente <avd@google.com>
Signed-off-by: Antonio Vicente <avd@google.com>
@mattklein123
Copy link
Member

Assigning to @tonya11en for review. Thank you!

Comment on lines +249 to +250
interval_set.insert(23, 9223372036854775806UL);
interval_set.insert(24, 9223372036854775805UL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being changed?

Copy link
Contributor Author

@antoniovicente antoniovicente Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #9540
size_t is an unsigned type. -2 ends up being interpreted as 9223372036854775806UL

interval set requires insert arguments to be sorted in value, so interval_set.insert(-2, 23), also known as interval_set.insert(9223372036854775806UL, 23) triggers an ASSERT failure in debug modes.

request, Common::Redis::Utility::SetRequest::instance(), i, i + 2);
request, Common::Redis::Utility::SetRequest::instance(), i, i + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

@antoniovicente antoniovicente Mar 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #9541
This + 2 causes array out of bound access, see stack trace below.
createVariant and createLocalCompositeArray benchmarks also in this file have very similar code but use i+1 instead of i+2. I think this was an existing error in the benchmark which lay dormant since there were no tests for it.

[2020-03-17 02:43:10.078][15][critical][assert] [bazel-out/k8-fastbuild/bin/source/extensions/filters/network/common/redis/virtual_includes/codec_interface/extensions/filters/network/common/redis/codec.h:67] assert failure: end < base_array->asArray().size().
AddressSanitizer:DEADLYSIGNAL

ERROR: AddressSanitizer: ABRT on unknown address 0x14e380000000f (pc 0x7f840d1d0081 bp 0x7ffe76012050 sp 0x7ffe76011910 T0)
#0 0x7f840d1d0080 in __libc_signal_restore_set /build/glibc-G5rUEF/glibc-2.29/signal/../sysdeps/unix/sysv/linux/internal-signals.h:84 (discriminator 3)
#1 0x7f840d1d0080 in __GI_raise /build/glibc-G5rUEF/glibc-2.29/signal/../sysdeps/unix/sysv/linux/raise.c:48 (discriminator 3)
#2 0x7f840d1bb534 in __GI_abort /build/glibc-G5rUEF/glibc-2.29/stdlib/abort.c:79 (discriminator 6)
#3 0x5696cc2 in Envoy::Extensions::NetworkFilters::Common::Redis::RespValue::CompositeArray::CompositeArray(std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue, Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const&, unsigned long, unsigned long) ??:?
#4 0x5695334 in Envoy::Extensions::NetworkFilters::Common::Redis::RespValue::RespValue(std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue, Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const&, unsigned long, unsigned long) ??:?
#5 0x573ba54 in std::__1::__compressed_pair_elem<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const, 1, false>::__compressed_pair_elem<std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&, 0ul, 1ul, 2ul, 3ul>(std::__1::piecewise_construct_t, std::__1::tuple<std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&>, std::__1::__tuple_indices<0ul, 1ul, 2ul, 3ul>) ??:?
#6 0x5739f4d in std::__1::__compressed_pair<std::__1::allocator<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>, Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>::__compressed_pair<std::__1::allocator<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>&, std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&>(std::__1::piecewise_construct_t, std::__1::tuple<std::__1::allocator<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>&>, std::__1::tuple<std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&>) ??:?
#7 0x5738b73 in std::__1::__shared_ptr_emplace<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const, std::__1::allocator<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const> >::__shared_ptr_emplace<std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long>(std::__1::allocator<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>, std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&) ??:?
#8 0x5737abc in std::__1::shared_ptr<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const> std::__1::shared_ptr<Envoy::Extensions::NetworkFilters::Common::Redis::RespValue const>::make_shared<std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long>(std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue&, Envoy::Extensions::NetworkFilters::Common::Redis::Utility::SetRequest const&, unsigned long&, unsigned long&&) ??:?
#9 0x573748b in ZNSt3__111make_sharedIKN5Envoy10Extensions14NetworkFilters6Common5Redis9RespValueEJRNS_10shared_ptrIS6_EERKNS5_7Utility10SetRequestERmmEEENS_9enable_ifIXntsr8is_arrayIT_EE5valueENS8_ISH_EEE4typeEDpOT0 command_split_speed_test.cc:?
#10 0x5736b35 in Envoy::Extensions::NetworkFilters::RedisProxy::CommandSplitSpeedTest::createShared(std::__1::shared_ptrEnvoy::Extensions::NetworkFilters::Common::Redis::RespValue) ??:?
#11 0x5684672 in BM_Split_CreateShared(benchmark::State&) command_split_speed_test.cc:?
#12 0xc3a56f1 in benchmark::internal::FunctionBenchmark::Run(benchmark::State&) ??:?
#13 0xc409255 in benchmark::internal::BenchmarkInstance::Run(unsigned long, int, benchmark::internal::ThreadTimer*, benchmark::internal::ThreadManager*) const ??:?
#14 0xc3dd535 in benchmark::internal::(anonymous namespace)::RunInThread(benchmark::internal::BenchmarkInstance const*, unsigned long, int, benchmark::internal::ThreadManager*) benchmark_runner.cc:?
#15 0xc3da56e in benchmark::internal::(anonymous namespace)::BenchmarkRunner::DoNIterations() benchmark_runner.cc:?
#16 0xc3d8900 in benchmark::internal::(anonymous namespace)::BenchmarkRunner::DoOneRepetition(long) benchmark_runner.cc:?
#17 0xc3d7bba in benchmark::internal::(anonymous namespace)::BenchmarkRunner::BenchmarkRunner(benchmark::internal::BenchmarkInstance const&, std::__1::vector<benchmark::BenchmarkReporter::Run, std::__1::allocatorbenchmark::BenchmarkReporter::Run >) benchmark_runner.cc:?
#18 0xc3d6568 in benchmark::internal::RunBenchmark(benchmark::internal::BenchmarkInstance const&, std::__1::vector<benchmark::BenchmarkReporter::Run, std::__1::allocatorbenchmark::BenchmarkReporter::Run >
) ??:?
#19 0xc381a17 in benchmark::internal::(anonymous namespace)::RunBenchmarks(std::__1::vector<benchmark::internal::BenchmarkInstance, std::__1::allocatorbenchmark::internal::BenchmarkInstance > const&, benchmark::BenchmarkReporter*, benchmark::BenchmarkReporter*) benchmark.cc:?
#20 0xc37fd94 in benchmark::RunSpecifiedBenchmarks(benchmark::BenchmarkReporter*, benchmark::BenchmarkReporter*) ??:?
#21 0xc37ee42 in benchmark::RunSpecifiedBenchmarks() ??:?
#22 0xbf76923 in main ??:?
#23 0x7f840d1bcbba in __libc_start_main /build/glibc-G5rUEF/glibc-2.29/csu/../csu/libc-start.c:308
#24 0x55da029 in _start ??:?

AddressSanitizer can not provide additional info.

Copy link
Member

@tonya11en tonya11en left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks. LGTM.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic, thanks.

@mattklein123 mattklein123 merged commit b837aa0 into envoyproxy:master Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[benchmark] ASSERT failure in //test/extensions/filters/network/redis_proxy:command_split_speed_test_test
3 participants