-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Closed as not planned
Copy link
Description
Describe the issue
Starting with 91b7cd6 and at least up to 9bff2a9, when I run my project's tests with sanitizers enabled, an undefined behavior error is reported. Here's the report summary:
external/envoy/source/common/http/status.cc:64:10: runtime error: reference binding to misaligned address 0x606000207ac9 for type 'const Envoy::Http::(anonymous namespace)::EnvoyStatusPayload', which requires 4 byte alignment
0x606000207ac9: note: pointer points here
00 00 00 08 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
#0 0x66707f4 in Envoy::Http::getStatusCode(absl::Status const&) ??:?
#1 0x6672298 in Envoy::Http::isPrematureResponseError(absl::Status const&) ??:?
#2 0x4dff157 in Envoy::Http::CodecClient::onData(Envoy::Buffer::Instance&) ??:?
#3 0x4e07668 in Envoy::Http::CodecClient::CodecReadFilter::onData(Envoy::Buffer::Instance&, bool) ??:?
#4 0x61c3397 in Envoy::Network::FilterManagerImpl::onContinueReading(Envoy::Network::FilterManagerImpl::ActiveReadFilter*, Envoy::Network::ReadBufferSource&) ??:?
#5 0x61c3a3a in Envoy::Network::FilterManagerImpl::onRead() ??:?
#6 0x619a3da in Envoy::Network::ConnectionImpl::onRead(unsigned long) ??:?
#7 0x61ac39a in Envoy::Network::ConnectionImpl::onReadReady() ??:?
#8 0x61a46cc in Envoy::Network::ConnectionImpl::onFileEvent(unsigned int) ??:?
#9 0x61b7672 in std::_Function_handler<void (unsigned int), Envoy::Network::ConnectionImpl::ConnectionImpl(Envoy::Event::Dispatcher&, std::unique_ptr<Envoy::Network::ConnectionSocket, std::default_delete<Envoy::Network::ConnectionSocket> >&&, std::unique_ptr<Envoy::Network::TransportSocket, std::default_delete<Envoy::Network::TransportSocket> >&&, Envoy::StreamInfo::StreamInfo&, bool)::$_6>::_M_invoke(std::_Any_data const&, unsigned int&&) connection_impl.cc:?
#10 0x382d878 in std::function<void (unsigned int)>::operator()(unsigned int) const ??:?
#11 0x6137e91 in std::_Function_handler<void (unsigned int), Envoy::Event::DispatcherImpl::createFileEvent(int, std::function<void (unsigned int)>, Envoy::Event::FileTriggerType, unsigned int)::$_5>::_M_invoke(std::_Any_data const&, unsigned int&&) dispatcher_impl.cc:?
#12 0x382d878 in std::function<void (unsigned int)>::operator()(unsigned int) const ??:?
#13 0x61474dd in Envoy::Event::FileEventImpl::mergeInjectedEventsAndRunCb(unsigned int) ??:?
#14 0x6147b76 in Envoy::Event::FileEventImpl::assignEvents(unsigned int, event_base*)::$_1::__invoke(int, short, void*) file_event_impl.cc:?
#15 0x6cfdf80 in event_process_active_single_queue event.c:?
#16 0x6cde7d2 in event_base_loop ??:?
#17 0x651eaee in Envoy::Event::LibeventScheduler::run(Envoy::Event::Dispatcher::RunType) ??:?
#18 0x6131828 in Envoy::Event::DispatcherImpl::run(Envoy::Event::Dispatcher::RunType) ??:?
#19 0x33b938f in Envoy::sendRequestAndWaitForResponse(Envoy::Event::Dispatcher&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Envoy::Http::CodecClientProd&) ??:?
#20 0x33ba95f in Envoy::IntegrationUtil::makeSingleRequest(std::shared_ptr<Envoy::Network::Address::Instance const> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Envoy::Http::CodecType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ??:?
#21 0x33bc5d7 in Envoy::IntegrationUtil::makeSingleRequest(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Envoy::Http::CodecType, Envoy::Network::Address::IpVersion, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ??:?
#22 0x2caa271 in Envoy::XdsIntegrationTest::getCounterValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ??:?
#23 0x2cab1df in Envoy::XdsIntegrationTest::waitForCounterGe(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long) ??:?
#24 0x2bf2f89 in Envoy::(anonymous namespace)::SdsIntegrationTest_SdsForUpstreamCluster_Test::TestBody() sds_integration_test.cc:?
#25 0x2bf439f in non-virtual thunk to Envoy::(anonymous namespace)::SdsIntegrationTest_SdsForUpstreamCluster_Test::TestBody() sds_integration_test.cc:?
#26 0x7b42104 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ??:?
#27 0x7b1c4bb in testing::Test::Run() ??:?
#28 0x7b1db14 in testing::TestInfo::Run() ??:?
#29 0x7b1f20c in testing::TestSuite::Run() ??:?
#30 0x7b35bbc in testing::internal::UnitTestImpl::RunAllTests() ??:?
#31 0x7b45484 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ??:?
#32 0x7b35018 in testing::UnitTest::Run() ??:?
#33 0x6046d31 in Envoy::TestRunner::RunTests(int, char**) ??:?
#34 0x6043443 in main ??:?
#35 0x7f497995f082 in __libc_start_main ??:?
#36 0x2b336ad in _start ??:?
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior external/envoy/source/common/http/status.cc:64:10 in
Steps to reproduce the problem
With Docker installed:
$ docker run -it envoyproxy/envoy-build-ubuntu:b0ff77ae3f25b0bf595f9b8bba46b489723ab446 bash
$ git clone https://github.com/abseil/abseil-cpp.git
$ git clone https://github.com/envoyproxy/envoy.git
$ export CC=/opt/llvm/bin/clang
$ export CXX=/opt/llvm/bin/clang++
$ cd envoy/mobile/
$ ./bazelw test --override_repository=com_google_absl=/abseil-cpp --test_output=all --test_env=ENVOY_IP_TEST_VERSIONS=v4only --config=asan //test/common/integration:client_integration_testIf you check out 90965f4 in /abseil-cpp and re-run the ./bazelw command the tests pass with no UB reported. 91b7cd6 up to 9bff2a9 all report UB.
What version of Abseil are you using?
- Last
mastercommit without the undefined behavior: 90965f4 - First
mastercommit with the undefined behavior: 91b7cd6 - Latest
mastercommit verified to have the undefined behavior: 9bff2a9
What operating system and version are you using?
- Operating System: Linux Ubuntu 20.04.5 LTS (Focal Fossa)
- Docker Image:
envoyproxy/envoy-build-ubuntu:b0ff77ae3f25b0bf595f9b8bba46b489723ab446
What compiler and version are you using?
clang version 14.0.0 (http://git.linaro.org/toolchain/jenkins-scripts.git 3157e5d15f6bcd69b98455f9a5bc31e34fdc6123)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm/bin
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/aarch64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64
What build system are you using?
- Bazelisk version: v1.15.0
- Build label: 6.0.0rc4
Additional context
I encountered this when updating Envoy's abseil-cpp dependency in envoyproxy/envoy#24386
Here's one of the failing CI jobs: https://github.com/envoyproxy/envoy/actions/runs/3644955588/jobs/6154673370
And another: https://dev.azure.com/cncf/envoy/_build/results?buildId=122940&view=logs&jobId=1439b9f7-a348-5b50-b5fe-ea612ea91241&j=1439b9f7-a348-5b50-b5fe-ea612ea91241&t=37b0a9be-1a71-50b3-594a-4c04a031247d
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels