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

redis: Fix stack-use-after-scope in test #10840

Merged
merged 2 commits into from
Apr 21, 2020

Conversation

euroelessar
Copy link
Contributor

Description: Capture status by copy instead of referencing stack used for function arguments.
Risk Level: n/a (test only)
Testing: n/a
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@euroelessar
Copy link
Contributor Author

euroelessar commented Apr 19, 2020

Failure link: https://dev.azure.com/cncf/envoy/_build/results?buildId=37654&view=logs&j=930b2ee4-0ea7-5b74-a645-6bc26962bc06&t=a22da363-b496-51fd-d3eb-ba836106d671&l=2237
ASAN failure:

2020-04-18T23:23:29.3240500Z [ RUN      ] RedisClusterTest.EmptyDnsResponse
2020-04-18T23:23:29.3241330Z =================================================================
2020-04-18T23:23:29.3242895Z ==17==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffc80f91b40 at pc 0x00000e287010 bp 0x7ffc80f8f7b0 sp 0x7ffc80f8f7a8
2020-04-18T23:23:29.3243471Z READ of size 4 at 0x7ffc80f91b40 thread T0
2020-04-18T23:23:29.3247708Z     #0 0xe28700f in Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>) const /proc/self/cwd/test/extensions/clusters/redis/redis_cluster_test.cc:155:14
2020-04-18T23:23:29.3261363Z     #1 0xe286c46 in decltype(std::__1::forward<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)&>(fp)(std::__1::forward<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(fp0), std::__1::forward<Envoy::Network::DnsLookupFamily>(fp0), std::__1::forward<std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >(fp0))) std::__1::__invoke<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >(Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily&&, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>&&) /opt/llvm/bin/../include/c++/v1/type_traits:3530:1
2020-04-18T23:23:29.3276582Z     #2 0xe28674a in Envoy::Network::ActiveDnsQuery* std::__1::__invoke_void_return_wrapper<Envoy::Network::ActiveDnsQuery*>::__call<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >(Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily&&, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>&&) /opt/llvm/bin/../include/c++/v1/__functional_base:317:16
2020-04-18T23:23:29.3308884Z     #3 0xe2864f8 in std::__1::__function::__alloc_func<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>), std::__1::allocator<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>, Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily&&, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>&&) /opt/llvm/bin/../include/c++/v1/functional:1533:16
2020-04-18T23:23:29.3321408Z     #4 0xe280ced in std::__1::__function::__func<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>), std::__1::allocator<Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>, Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily&&, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>&&) /opt/llvm/bin/../include/c++/v1/functional:1707:12
2020-04-18T23:23:29.3327893Z     #5 0x11990a87 in std::__1::__function::__value_func<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily&&, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>&&) const /opt/llvm/bin/../include/c++/v1/functional:1860:16
2020-04-18T23:23:29.3331340Z     #6 0x119903a1 in std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>) const /opt/llvm/bin/../include/c++/v1/functional:2419:12
2020-04-18T23:23:29.3341678Z     #7 0x1198fe94 in decltype(std::forward<std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&>(fp)(std::get<0ul>(std::forward<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >(fp0)), std::get<1ul>(std::forward<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >(fp0)), std::get<2ul>(std::forward<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >(fp0)))) testing::internal::ApplyImpl<std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >, 0ul, 1ul, 2ul>(std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >&&, testing::internal::IndexSequence<0ul, 1ul, 2ul>) /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:462:10
2020-04-18T23:23:29.3386463Z     #8 0x1198f7fd in decltype(ApplyImpl(std::forward<std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&>(fp), std::forward<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >(fp0), (testing::internal::MakeIndexSequence<std::tuple_size<std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >::value>)())) testing::internal::Apply<std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> > >(std::__1::function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&, std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >&&) /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:470:10
2020-04-18T23:23:29.3395429Z     #9 0x1198ce04 in testing::Action<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::Perform(std::__1::tuple<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)> >) const /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:392:12
2020-04-18T23:23:29.3401486Z     #10 0x119916e6 in testing::internal::ActionResultHolder<Envoy::Network::ActiveDnsQuery*>* testing::internal::ActionResultHolder<Envoy::Network::ActiveDnsQuery*>::PerformAction<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>(testing::Action<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)> const&, testing::internal::Function<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::ArgumentTuple&&) /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/gmock-spec-builders.h:1409:24
2020-04-18T23:23:29.3406768Z     #11 0x1198a163 in testing::internal::FunctionMocker<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::UntypedPerformAction(void const*, void*) const /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/gmock-spec-builders.h:1563:12
2020-04-18T23:23:29.3408807Z     #12 0x1b293f22 in testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(void*) /proc/self/cwd/external/com_google_googletest/googlemock/src/gmock-spec-builders.cc:448:24
2020-04-18T23:23:29.3412089Z     #13 0xe07ca91 in testing::internal::FunctionMocker<Envoy::Network::ActiveDnsQuery* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)>::Invoke(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>) /proc/self/cwd/external/com_google_googletest/googlemock/include/gmock/gmock-spec-builders.h:1600:15
2020-04-18T23:23:29.3415088Z     #14 0xe07c518 in Envoy::Network::MockDnsResolver::resolve(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>) /proc/self/cwd/./test/mocks/network/mocks.h:45:3
2020-04-18T23:23:29.3416576Z     #15 0xe4643d2 in Envoy::Extensions::Clusters::Redis::RedisCluster::DnsDiscoveryResolveTarget::startResolveDns() /proc/self/cwd/source/extensions/clusters/redis/redis_cluster.cc:159:42
2020-04-18T23:23:29.3417481Z     #16 0xe463a0c in Envoy::Extensions::Clusters::Redis::RedisCluster::startPreInit() /proc/self/cwd/source/extensions/clusters/redis/redis_cluster.cc:73:13
2020-04-18T23:23:29.3418321Z     #17 0x127e672b in Envoy::Upstream::ClusterImplBase::initialize(std::__1::function<void ()>) /proc/self/cwd/source/common/upstream/upstream_impl.cc:950:3
2020-04-18T23:23:29.3419193Z     #18 0xdf79997 in Envoy::Extensions::Clusters::Redis::RedisClusterTest_EmptyDnsResponse_Test::TestBody() /proc/self/cwd/test/extensions/clusters/redis/redis_cluster_test.cc:659:13
2020-04-18T23:23:29.3420252Z     #19 0x1b3e882d in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2433:10
2020-04-18T23:23:29.3421489Z     #20 0x1b396c25 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2469:14
2020-04-18T23:23:29.3422412Z     #21 0x1b3409e6 in testing::Test::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2508:5
2020-04-18T23:23:29.3423095Z     #22 0x1b3436ef in testing::TestInfo::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2684:11
2020-04-18T23:23:29.3423789Z     #23 0x1b345e5b in testing::TestSuite::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2816:28
2020-04-18T23:23:29.3424514Z     #24 0x1b376f01 in testing::internal::UnitTestImpl::RunAllTests() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:5338:44
2020-04-18T23:23:29.3425578Z     #25 0x1b3fc4cb in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2433:10
2020-04-18T23:23:29.3427078Z     #26 0x1b3a21a5 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2469:14
2020-04-18T23:23:29.3428107Z     #27 0x1b374d27 in testing::UnitTest::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:4925:10
2020-04-18T23:23:29.3428918Z     #28 0x13f9a7ef in RUN_ALL_TESTS() /proc/self/cwd/external/com_google_googletest/googletest/include/gtest/gtest.h:2473:46
2020-04-18T23:23:29.3429711Z     #29 0x13f9789e in Envoy::TestRunner::RunTests(int, char**) /proc/self/cwd/test/test_runner.cc:134:10
2020-04-18T23:23:29.3430267Z     #30 0x13f9041a in main /proc/self/cwd/test/main.cc:46:10
2020-04-18T23:23:29.3431117Z     #31 0x7fcd4140782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
2020-04-18T23:23:29.3432152Z     #32 0xdecc028 in _start (/b/f/w/bazel-out/k8-dbg/bin/test/extensions/clusters/redis/redis_cluster_test.runfiles/envoy/test/extensions/clusters/redis/redis_cluster_test+0xdecc028)
2020-04-18T23:23:29.3432695Z 
2020-04-18T23:23:29.3433075Z Address 0x7ffc80f91b40 is located in stack of thread T0 at offset 32 in frame
2020-04-18T23:23:29.3433752Z     #0 0x127e579f in Envoy::Upstream::ClusterImplBase::initialize(std::__1::function<void ()>) /proc/self/cwd/source/common/upstream/upstream_impl.cc:946
2020-04-18T23:23:29.3434266Z 
2020-04-18T23:23:29.3434589Z   This frame has 8 object(s):
2020-04-18T23:23:29.3435277Z     [32, 56) 'ref.tmp' (line 947) <== Memory access at offset 32 is inside this variable
2020-04-18T23:23:29.3435920Z     [96, 120) 'agg.tmp'
2020-04-18T23:23:29.3436459Z     [160, 176) 'agg.tmp21'
2020-04-18T23:23:29.3437008Z     [192, 200) 'ref.tmp23' (line 947)
2020-04-18T23:23:29.3437597Z     [224, 248) 'ref.tmp45' (line 948)
2020-04-18T23:23:29.3438143Z     [288, 312) 'agg.tmp68'
2020-04-18T23:23:29.3438704Z     [352, 368) 'agg.tmp70'
2020-04-18T23:23:29.3439268Z     [384, 392) 'ref.tmp72' (line 948)
2020-04-18T23:23:29.3439771Z HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
2020-04-18T23:23:29.3440303Z       (longjmp and C++ exceptions *are* supported)
2020-04-18T23:23:29.3443740Z SUMMARY: AddressSanitizer: stack-use-after-scope /proc/self/cwd/test/extensions/clusters/redis/redis_cluster_test.cc:155:14 in Envoy::Extensions::Clusters::Redis::RedisClusterTest::expectResolveDiscovery(Envoy::Network::DnsLookupFamily, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, Envoy::Network::DnsResolver::ResolutionStatus)::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Network::DnsLookupFamily, std::__1::function<void (Envoy::Network::DnsResolver::ResolutionStatus, std::__1::list<Envoy::Network::DnsResponse, std::__1::allocator<Envoy::Network::DnsResponse> >&&)>)::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Envoy::Net
2020-04-18T23:23:29.3446475Z Shadow bytes around the buggy address:
2020-04-18T23:23:29.3446959Z   0x1000101ea310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3447457Z   0x1000101ea320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3447936Z   0x1000101ea330: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
2020-04-18T23:23:29.3448414Z   0x1000101ea340: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3449010Z   0x1000101ea350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3449503Z =>0x1000101ea360: 00 00 00 00 f1 f1 f1 f1[f8]f8 f8 f2 f2 f2 f2 f2
2020-04-18T23:23:29.3449982Z   0x1000101ea370: 00 00 00 f2 f2 f2 f2 f2 00 00 f2 f2 f8 f2 f2 f2
2020-04-18T23:23:29.3450446Z   0x1000101ea380: f8 f8 f8 f2 f2 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2
2020-04-18T23:23:29.3450924Z   0x1000101ea390: 00 00 f2 f2 f8 f3 f3 f3 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3451384Z   0x1000101ea3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3451941Z   0x1000101ea3b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2020-04-18T23:23:29.3452430Z Shadow byte legend (one shadow byte represents 8 application bytes):
2020-04-18T23:23:29.3452898Z   Addressable:           00
2020-04-18T23:23:29.3453265Z   Partially addressable: 01 02 03 04 05 06 07 
2020-04-18T23:23:29.3453631Z   Heap left redzone:       fa
2020-04-18T23:23:29.3453955Z   Freed heap region:       fd
2020-04-18T23:23:29.3454297Z   Stack left redzone:      f1
2020-04-18T23:23:29.3454635Z   Stack mid redzone:       f2
2020-04-18T23:23:29.3473334Z   Stack right redzone:     f3
2020-04-18T23:23:29.3473921Z   Stack after return:      f5
2020-04-18T23:23:29.3474278Z   Stack use after scope:   f8
2020-04-18T23:23:29.3474648Z   Global redzone:          f9
2020-04-18T23:23:29.3475008Z   Global init order:       f6
2020-04-18T23:23:29.3475355Z   Poisoned by user:        f7
2020-04-18T23:23:29.3475714Z   Container overflow:      fc
2020-04-18T23:23:29.3476073Z   Array cookie:            ac
2020-04-18T23:23:29.3476419Z   Intra object redzone:    bb
2020-04-18T23:23:29.3476787Z   ASan internal:           fe
2020-04-18T23:23:29.3477137Z   Left alloca redzone:     ca
2020-04-18T23:23:29.3477501Z   Right alloca redzone:    cb
2020-04-18T23:23:29.3478226Z   Shadow gap:              cc
2020-04-18T23:23:29.3478557Z ==17==ABORTING

@euroelessar
Copy link
Contributor Author

It looks like the failed test is broken at HEAD.

Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
@mattklein123
Copy link
Member

@HenryYYang PTAL

@HenryYYang
Copy link
Contributor

👍

@HenryYYang
Copy link
Contributor

thanks for fixing this.

@mattklein123 mattklein123 merged commit ed55058 into envoyproxy:master Apr 21, 2020
penguingao pushed a commit to penguingao/envoy that referenced this pull request Apr 22, 2020
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
Signed-off-by: pengg <pengg@google.com>
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.

3 participants