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

Small license tidy ups #1

Closed
wants to merge 4 commits into from
Closed

Small license tidy ups #1

wants to merge 4 commits into from

Conversation

jamesgpearce
Copy link

No description provided.

@djwatson djwatson closed this Feb 11, 2014
pavlo-fb pushed a commit that referenced this pull request Nov 8, 2014
Summary:
So I think here is the problem:
- Request #1 fires, SASL times out, we fall back the channel to insecure mode and send a request.
- The request comes back, we detach the event base from the channel and put it in the idle pool.
- At this point the SASL thread could still be chugging along trying to talk to the KDC, etc.
- Request #2 fires, takes the channel off the idle pool, attaches another evb to it. This request is now in flight
- The SASL threads finally completes, and since we now have a valid evb on the channel it fires a saslSendServer (which schedules another timeout on the channel)
- Response #2 comes back, we try to detach from the channel but can't since there is a request in progress and a timeout set.

Test Plan: unit tests

Reviewed By: mshneer@fb.com

Subscribers: alandau, bmatheny, mshneer, wstefancik

FB internal diff: D1635252
viswanathgs pushed a commit that referenced this pull request Jan 14, 2015
Summary:
* thrift/lib/cpp/test/TAsyncSSLSocketTest.cpp:
(SSLParseClientHelloOnePacket): Declare the local int array,
"fds" to be of length 2, (not 1) as required by "getfds".
SSLParseClientHelloTwoPackets): Likewise.
(SSLParseClientHelloMultiplePackets): Likewise.

Here is the ASAN report:

==23074== ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff5b5ad5e4 at pc 0x40c7ec bp 0x7fff5b5ad3a0 sp 0x7fff5b5ad398
READ of size 4 at 0x7fff5b5ad5e4 thread T0
#0 0x40c7eb in getfds(int*) /tmp/thrift/lib/cpp/test/TAsyncSSLSocketTest.h:656
#1 0x41a57f in TAsyncSSLSocketTest_SSLParseClientHelloOnePacket_Test::TestBody() /tmp/thrift/lib/cpp/test/TAsyncSSLSocketTest.cpp:723
#2 0x563ff8 in HandleSehExceptionsInMethodIfSupported<testing::Test, void> /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:2078
#3 0x558a24 in testing::Test::Run() /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:2151
#4 0x558b04 in testing::TestInfo::Run() /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:2326
#5 0x558c6e in testing::TestCase::Run() /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:2444
#6 0x55d41c in testing::internal::UnitTestImpl::RunAllTests() /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:4315
#7 0x55d6ff in testing::internal::UnitTestImpl::RunAllTests() /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/src/gtest.cc:4232
#8 0x542961 in RUN_ALL_TESTS /home/engshare/third-party2/gtest/1.7.0/src/gtest-1.7.0/include/gtest/gtest.h:2288
#3 0x7ffda054eefe in __libc_start_main ??:?
#10 0x40bdd8 in _start /home/engshare/third-party2/glibc/2.17/src/glibc-2.17/sysdeps/x86_64/start.S:123
Address 0x7fff5b5ad5e4 is located at offset 164 in frame <TestBody> of T0's stack:
This frame has 9 object(s):
[32, 33) 'majorVersion'
[96, 97) 'minorVersion'
[160, 164) 'fds'

Interestingly, this began showing up in my nightly test results
only around Dec 29th or so, even though the blamed diff is from months ago.

Test Plan:
Run these commands and confirm there are no more ASAN aborts:
fbconfig --sanitize=address thrift/lib/cpp/test:TAsyncSSLSocketTest
fbmake runtests

Reviewed By: pgriess@fb.com, sugak@fb.com

Subscribers: net-systems@, alandau, bmatheny, mshneer, sugak

FB internal diff: D1778820

Tasks: 2392412

Signature: t1:1778820:1421114269:aa0f1d9470fd19eed7c3101dc38a28dc360051ad
ghost pushed a commit that referenced this pull request Feb 6, 2016
…er-free in a test

Summary:
Building/testing with gcc-4.9+ASAN would fail with this SIOF error:

  =================================================================
  ==2063684==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x000000eb4440 at pc 0x4e965e bp 0x7ffeb572d3f0 sp 0x7ffeb572d3e8
  READ of size 4 at 0x000000eb4440 thread T0
      #0 0x4e965d in apache::thrift::BaseThriftServer::BaseThriftServer() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x4e965d)
      #1 0x4daaf7 in apache::thrift::ThriftServer::ThriftServer(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&, bool) thrift/lib/cpp2/server/ThriftServer.cpp:94
      #2 0x4daa29 in apache::thrift::ThriftServer::ThriftServer() thrift/lib/cpp2/server/ThriftServer.cpp:88
      #3 0x44f587 in void __gnu_cxx::new_allocator<apache::thrift::ThriftServer>::construct<apache::thrift::ThriftServer>(apache::thrift::ThriftServer*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44f587)
      #4 0x44efd9 in std::enable_if<std::allocator_traits<std::allocator<apache::thrift::ThriftServer> >::__construct_helper<apache::thrift::ThriftServer>::type::value, void>::type std::allocator_traits<std::allocator<apache::thrift::ThriftServer> >::_S_construct<apache::thrift::ThriftServer>(std::allocator<apache::thrift::ThriftServer>&, apache::thrift::ThriftServer*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44efd9)
      #5 0x44eb23 in decltype (_S_construct({parm#1}, {parm#2})) std::allocator_traits<std::allocator<apache::thrift::ThriftServer> >::construct<apache::thrift::ThriftServer>(std::allocator<apache::thrift::ThriftServer>&, apache::thrift::ThriftServer*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44eb23)
      #6 0x44e5ac in std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<apache::thrift::ThriftServer>) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44e5ac)
      #7 0x44dd7e in void __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> >::construct<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>, std::allocator<apache::thrift::ThriftServer> const>(std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>*, std::allocator<apache::thrift::ThriftServer> const&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44dd7e)
      #8 0x44d4ee in std::enable_if<std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> > >::__construct_helper<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>, std::allocator<apache::thrift::ThriftServer> const>::type::value, void>::type std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> > >::_S_construct<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>, std::allocator<apache::thrift::ThriftServer> const>(std::allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>*, std::allocator<apache::thrift::ThriftServer> const&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44d4ee)
      #9 0x44c10e in decltype (_S_construct({parm#1}, {parm#2}, (forward<std::allocator<apache::thrift::ThriftServer> const>)({parm#3}))) std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> > >::construct<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>, std::allocator<apache::thrift::ThriftServer> const>(std::allocator<std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>, (__gnu_cxx::_Lock_policy)2>*, std::allocator<apache::thrift::ThriftServer> const&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44c10e)
      #10 0x44abb7 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>>(std::_Sp_make_shared_tag, apache::thrift::ThriftServer*, std::allocator<apache::thrift::ThriftServer> const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44abb7)
      #11 0x448143 in std::__shared_ptr<apache::thrift::ThriftServer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<apache::thrift::ThriftServer>>(std::_Sp_make_shared_tag, std::allocator<apache::thrift::ThriftServer> const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x448143)
      #12 0x44496d in std::shared_ptr<apache::thrift::ThriftServer>::shared_ptr<std::allocator<apache::thrift::ThriftServer>>(std::_Sp_make_shared_tag, std::allocator<apache::thrift::ThriftServer> const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x44496d)
      #13 0x43f179 in std::shared_ptr<apache::thrift::ThriftServer> std::allocate_shared<apache::thrift::ThriftServer, std::allocator<apache::thrift::ThriftServer>>(std::allocator<apache::thrift::ThriftServer> const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x43f179)
      #14 0x437d94 in std::shared_ptr<apache::thrift::ThriftServer> std::make_shared<apache::thrift::ThriftServer>() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x437d94)
      #15 0x43158b in apache::thrift::TestThriftServerFactory<StreamingServiceInterface>::create() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/lib/cpp2/test/StreamingTest+0x43158b)
      #16 0x41e676 in __static_initialization_and_destruction_0 thrift/lib/cpp2/test/StreamingTest.cpp:57
      #17 0x41e946 in _GLOBAL__sub_I_factory thrift/lib/cpp2/test/StreamingTest.cpp:219
      #18 0xa63eee in __libc_csu_init /home/engshare/third-party2/glibc/2.20/src/glibc-2.20/csu/elf-init.c:88
      #19 0x7fd9cc787084 in __libc_start_main (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libc.so.6+0x20084)
      #0 0x414ba5 in _start /home/engshare/third-party2/glibc/2.20/src/glibc-2.20/csu/../sysdeps/x86_64/start.S:122

The fix is to make "sst" a meyers singleton. This is only a test, and it now works, so not worth seeing if we might actually need folly::Singleton.
There was also a heap use after free:

  [==========] Running 1 test from 1 test case.
  [----------] Global test environment set-up.
  [----------] 1 test from FetcherHandlerTest
  [ RUN      ] FetcherHandlerTest.example_pass
  =================================================================
  ==2542675==ERROR: AddressSanitizer: heap-use-after-free on address 0x61100003be00 at pc 0x51a786 bp 0x7fe84e344a60 sp 0x7fe84e344a58
  READ of size 4 at 0x61100003be00 thread T5
      #0 0x51a785 in folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::Try(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/futures/Try-inl.h:26
      #1 0x518eac in void folly::Optional<folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::construct<folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/Optional.h:266
      #2 0x517b49 in folly::Optional<folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::Optional(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/Optional.h:128
      #3 0x515297 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::Core(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/futures/detail/Core.h:88
      #4 0x5143e0 in folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > folly::makeFuture<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/futures/Future-inl.h:543
      #5 0x50954d in folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::ensure<apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}>(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4})::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x50954d)
      #6 0x50a8d5 in std::enable_if<folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>::ReturnsFuture::value, folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>::Return>::type folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::thenImplementation<folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::ensure<apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}>(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4})::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}, folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>, true, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}, {lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}::argResult<true, apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >)::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >)#1}::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x50a8d5)
      #7 0x50ecad in operator() folly/futures/detail/Core.h:137
      #8 0x50dd99 in _M_invoke third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2069
      #9 0x51909e in std::function<void (folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)>::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) const third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2439
      #10 0x5172c2 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::doCallback() folly/futures/detail/Core.h:355
      #11 0x51503b in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2}::operator()() const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51503b)
      #12 0x5175c3 in bool folly::detail::FSM<folly::detail::State>::updateState<folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#1}, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2}>(folly::detail::State, folly::detail::State, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#1} const&, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2} const&) folly/futures/detail/FSM.h:100
      #13 0x5150b8 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback() folly/futures/detail/Core.h:309
      #14 0x5141d4 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::setResult(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/futures/detail/Core.h:204
      #15 0x513c2a in folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::setTry(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) folly/futures/Promise-inl.h:117
      #16 0x5128d4 in void folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::setValue<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >&&) folly/futures/Promise-inl.h:126
      #17 0x508a26 in apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >)#1}::operator()(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >) const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x508a26)
      #18 0x5097d5 in _M_invoke third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2039
      #19 0x51fb74 in std::function<void (std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&)>::operator()(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&) const third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2439
      #20 0x51f1a3 in apache::thrift::tutorial::fetcher::HttpFetcher::readEOF() thrift/tutorial/cpp/async/fetcher/HttpFetcher.cpp:88
      #21 0x83c394 in folly::AsyncSocket::handleRead() folly/io/async/AsyncSocket.cpp:1405
      #22 0x83a742 in folly::AsyncSocket::ioReady(unsigned short) folly/io/async/AsyncSocket.cpp:1245
      #23 0x8448f7 in folly::AsyncSocket::IoHandler::handlerReady(unsigned short) folly/io/async/AsyncSocket.h:634
      #24 0x860b30 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
      #25 0xa51889 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
      #26 0xa51a8f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
      #27 0x84c201 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:335
      #28 0x84bcc6 in folly::EventBase::loop() folly/io/async/EventBase.cpp:287
      #29 0x84d3d2 in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:435
      #30 0x67e771 in wangle::IOThreadPoolExecutor::threadRun(std::shared_ptr<wangle::ThreadPoolExecutor::Thread>) wangle/concurrent/IOThreadPoolExecutor.cpp:149
      #31 0x693623 in void std::_Mem_fn<void (wangle::ThreadPoolExecutor::*)(std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)>::operator()<std::shared_ptr<wangle::ThreadPoolExecutor::Thread>&, void>(wangle::ThreadPoolExecutor*, std::shared_ptr<wangle::ThreadPoolExecutor::Thread>&) const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x693623)
      #32 0x691902 in void std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::*)(std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)> (wangle::ThreadPoolExecutor*, std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1264
      #33 0x68e593 in void std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::*)(std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)> (wangle::ThreadPoolExecutor*, std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)>::operator()<, void>() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x68e593)
      #34 0x68b733 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::*)(std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)> (wangle::ThreadPoolExecutor*, std::shared_ptr<wangle::ThreadPoolExecutor::Thread>)> >::_M_invoke(std::_Any_data const&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2039
      #35 0x43827b in std::function<void ()>::operator()() const third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2439
      #36 0x4b5eb7 in void std::_Bind_simple<std::function<void ()> ()>::_M_invoke<>(std::_Index_tuple<>) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1700
      #37 0x4b4dae in std::_Bind_simple<std::function<void ()> ()>::operator()() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1688
      #38 0x4b2f17 in std::thread::_Impl<std::_Bind_simple<std::function<void ()> ()> >::_M_run() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/thread:115
      #39 0x7fe853c6c360 in execute_native_thread_routine (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libstdc++.so.6+0xe5360)
      #40 0x7fe8543067f0 in start_thread (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libpthread.so.0+0x77f0)
      #41 0x7fe854d5046c in __clone (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libc.so.6+0x10d46c)

  0x61100003be00 is located 64 bytes inside of 208-byte region [0x61100003bdc0,0x61100003be90)
  freed by thread T5 here:
      #0 0x7fe855b89937 in operator delete(void*) (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libasan.so.1+0x59937)
      #1 0x518f5d in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::detachOne() folly/futures/detail/Core.h:364
      #2 0x51b424 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::detachPromise() folly/futures/detail/Core.h:221
      #3 0x519e6e in folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::detach() folly/futures/Promise-inl.h:72
      #4 0x517c5d in folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::~Promise() folly/futures/Promise-inl.h:64
      #5 0x51e799 in void __gnu_cxx::new_allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::destroy<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51e799)
      #6 0x51e64d in std::enable_if<std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::__destroy_helper<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::type::value, void>::type std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::_S_destroy<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >&, folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51e64d)
      #7 0x51e545 in void std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::destroy<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >&, folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/alloc_traits.h:398
      #8 0x51e2c8 in std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>::_M_dispose() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/shared_ptr_base.h:524
      #9 0x422436 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/shared_ptr_base.h:149
      #10 0x41f177 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/shared_ptr_base.h:666
      #11 0x511ad7 in std::__shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x511ad7)
      #12 0x511af1 in std::shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::~shared_ptr() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x511af1)
      #13 0x508a45 in apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda(std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >)#1}::~basic_fbstring() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x508a45)
      #14 0x509fdd in _M_destroy third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1894
      #15 0x509947 in _M_manager third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1918
      #16 0x418581 in std::_Function_base::~_Function_base() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:1998
      #17 0x511831 in std::function<void (std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&)>::~function() third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2142
      #18 0x51fdd2 in apache::thrift::tutorial::fetcher::HttpFetcher::~HttpFetcher() thrift/tutorial/cpp/async/fetcher/HttpFetcher.h:33
      #19 0x51fe37 in apache::thrift::tutorial::fetcher::HttpFetcher::~HttpFetcher() thrift/tutorial/cpp/async/fetcher/HttpFetcher.h:33
      #20 0x508d4b in apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}::operator()() const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x508d4b)
      #21 0x50952f in folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::ensure<apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}>(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4})::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x50952f)
      #22 0x50a8d5 in std::enable_if<folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>::ReturnsFuture::value, folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>::Return>::type folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::thenImplementation<folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > folly::Future<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::ensure<apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}>(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4})::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}, folly::detail::callableResult<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&>, true, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >(apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}, {lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)#1}::argResult<true, apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#4}, folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >)::{lambda(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >)#1}::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x50a8d5)
      #23 0x50ecad in operator() folly/futures/detail/Core.h:137
      #24 0x50dd99 in _M_invoke third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2069
      #25 0x51909e in std::function<void (folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&)>::operator()(folly::Try<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >&&) const third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2439
      #26 0x5172c2 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::doCallback() folly/futures/detail/Core.h:355
      #27 0x51503b in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2}::operator()() const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51503b)
      #28 0x5175c3 in bool folly::detail::FSM<folly::detail::State>::updateState<folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#1}, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2}>(folly::detail::State, folly::detail::State, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#1} const&, folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback()::{lambda()#2} const&) folly/futures/detail/FSM.h:100
      #29 0x5150b8 in folly::detail::Core<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::maybeCallback() folly/futures/detail/Core.h:309

  previously allocated by thread T2 here:
      #0 0x7fe855b894bf in operator new(unsigned long) (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libasan.so.1+0x594bf)
      #1 0x517c05 in folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >::Promise() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x517c05)
      #2 0x51d6e3 in void __gnu_cxx::new_allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::construct<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >>(folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51d6e3)
      #3 0x51d501 in std::enable_if<std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::__construct_helper<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >>::type::value, void>::type std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::_S_construct<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >>(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >&, folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51d501)
      #4 0x51d2eb in decltype (_S_construct({parm#1}, {parm#2})) std::allocator_traits<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >::construct<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >>(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >&, folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51d2eb)
      #5 0x51d07e in std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51d07e)
      #6 0x51c6e6 in void __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> >::construct<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const>(std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>*, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51c6e6)
      #7 0x51bbed in std::enable_if<std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> > >::__construct_helper<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const>::type::value, void>::type std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> > >::_S_construct<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const>(std::allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>*, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/bits/alloc_traits.h:247
      #8 0x51a70e in decltype (_S_construct({parm#1}, {parm#2}, (forward<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const>)({parm#3}))) std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> > >::construct<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const>(std::allocator<std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >, (__gnu_cxx::_Lock_policy)2>*, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51a70e)
      #9 0x518b99 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >>(std::_Sp_make_shared_tag, folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >*, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x518b99)
      #10 0x51676b in std::__shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >>(std::_Sp_make_shared_tag, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x51676b)
      #11 0x514edf in std::shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >::shared_ptr<std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >>(std::_Sp_make_shared_tag, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x514edf)
      #12 0x513b01 in std::shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > std::allocate_shared<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >>(std::allocator<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > const&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x513b01)
      #13 0x512762 in std::shared_ptr<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > std::make_shared<folly::Promise<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >>() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x512762)
      #14 0x508e59 in apache::thrift::tutorial::fetcher::FetcherHandler::future_fetchHttp(apache::thrift::tutorial::fetcher::FetchHttpRequest const&) thrift/tutorial/cpp/async/fetcher/FetcherHandler.cpp:35
      #15 0x520405 in apache::thrift::tutorial::fetcher::FetcherSvIf::async_tm_fetchHttp(std::unique_ptr<apache::thrift::HandlerCallback<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::default_delete<apache::thrift::HandlerCallback<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >, apache::thrift::tutorial::fetcher::FetchHttpRequest const&)::{lambda()#1}::operator()() const (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x520405)
      #16 0x520ae2 in future_catching<apache::thrift::tutorial::fetcher::FetcherSvIf::async_tm_fetchHttp(std::unique_ptr<apache::thrift::HandlerCallback<std::basic_fbstring<char> > >, const apache::thrift::tutorial::fetcher::FetchHttpRequest&)::<lambda()> > thrift/lib/cpp2/GeneratedCodeHelper.h:1090
      #17 0x520966 in async_tm<apache::thrift::tutorial::fetcher::FetcherSvIf::async_tm_fetchHttp(std::unique_ptr<apache::thrift::HandlerCallback<std::basic_fbstring<char> > >, const apache::thrift::tutorial::fetcher::FetchHttpRequest&)::<lambda()> > thrift/lib/cpp2/GeneratedCodeHelper.h:1127
      #18 0x52046b in apache::thrift::tutorial::fetcher::FetcherSvIf::async_tm_fetchHttp(std::unique_ptr<apache::thrift::HandlerCallback<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > >, std::default_delete<apache::thrift::HandlerCallback<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > > >, apache::thrift::tutorial::fetcher::FetchHttpRequest const&) _build/dbg/thrift/tutorial/cpp/async/fetcher/if-cpp2.thrift-gen/fetcher/gen-cpp2/Fetcher.cpp:29
      #19 0x53ba31 in void apache::thrift::tutorial::fetcher::FetcherAsyncProcessor::process_fetchHttp<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x53ba31)
      #20 0x53ca85 in void apache::thrift::GeneratedAsyncProcessor::processInThread<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter, void (apache::thrift::tutorial::fetcher::FetcherAsyncProcessor::*)(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*), apache::thrift::tutorial::fetcher::FetcherAsyncProcessor>(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*, apache::thrift::concurrency::PRIORITY, bool, void (apache::thrift::tutorial::fetcher::FetcherAsyncProcessor::*)(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*), apache::thrift::tutorial::fetcher::FetcherAsyncProcessor*)::{lambda()#1}::operator()() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x53ca85)
      #21 0x55b10a in std::_Function_handler<void (), void apache::thrift::GeneratedAsyncProcessor::processInThread<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter, void (apache::thrift::tutorial::fetcher::FetcherAsyncProcessor::*)(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*), apache::thrift::tutorial::fetcher::FetcherAsyncProcessor>(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*, apache::thrift::concurrency::PRIORITY, bool, void (apache::thrift::tutorial::fetcher::FetcherAsyncProcessor::*)(std::unique_ptr<apache::thrift::ResponseChannel::Request, std::default_delete<apache::thrift::ResponseChannel::Request> >, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >, std::unique_ptr<apache::thrift::CompactProtocolReader, std::default_delete<apache::thrift::CompactProtocolReader> >, apache::thrift::Cpp2RequestContext*, folly::EventBase*, apache::thrift::concurrency::ThreadManager*), apache::thrift::tutorial::fetcher::FetcherAsyncProcessor*)::{lambda()#1}>::_M_invoke(std::_Any_data const&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2039
      #22 0x43827b in std::function<void ()>::operator()() const third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/functional:2439
      #23 0x526dc0 in apache::thrift::EventTask::run() thrift/lib/cpp2/async/AsyncProcessor.h:61
      #24 0x43594a in apache::thrift::concurrency::ThreadManager::Task::run() thrift/lib/cpp/concurrency/ThreadManager-impl.h:59
      #25 0x455b8f in apache::thrift::concurrency::ThreadManager::ImplT<folly::LifoSemImpl<std::atomic, folly::Baton<std::atomic> > >::Worker<folly::LifoSemImpl<std::atomic, folly::Baton<std::atomic> > >::run() thrift/lib/cpp/concurrency/ThreadManager.tcc:122
      #26 0x79d9e5 in apache::thrift::concurrency::PthreadThread::threadMain(void*) thrift/lib/cpp/concurrency/PosixThreadFactory.cpp:194
      #27 0x7fe8543067f0 in start_thread (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libpthread.so.0+0x77f0)

  Thread T5 created by T3 here:
      #0 0x7fe855b5753a in pthread_create (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libasan.so.1+0x2753a)
      #1 0x7fe853c6daff in std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>) (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libstdc++.so.6+0xe6aff)
      #2 0x472a4e in std::thread::thread<std::function<void ()>>(std::function<void ()>&&) third-party2/libgcc/4.9.x/gcc-4.9-glibc-2.20-fb/024dbc3/include/c++/4.9.x/thread:135
      #3 0x469114 in wangle::NamedThreadFactory::newThread(std::function<void ()>&&) (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x469114)
      #4 0x684ed7 in wangle::ThreadPoolExecutor::addThreads(unsigned long) wangle/concurrent/ThreadPoolExecutor.cpp:92
      #5 0x684b1b in wangle::ThreadPoolExecutor::setNumThreads(unsigned long) wangle/concurrent/ThreadPoolExecutor.cpp:76
      #6 0x45febf in apache::thrift::ThriftServer::setup() thrift/lib/cpp2/server/ThriftServer.cpp:290
      #7 0x460b19 in apache::thrift::ThriftServer::serve() thrift/lib/cpp2/server/ThriftServer.cpp:351
      #8 0x61ddaa in apache::thrift::util::ScopedServerThread::Helper::run() thrift/lib/cpp/util/ScopedServerThread.cpp:173
      #9 0x79d9e5 in apache::thrift::concurrency::PthreadThread::threadMain(void*) thrift/lib/cpp/concurrency/PosixThreadFactory.cpp:194
      #10 0x7fe8543067f0 in start_thread (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libpthread.so.0+0x77f0)

  Thread T3 created by T0 here:
      #0 0x7fe855b5753a in pthread_create (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libasan.so.1+0x2753a)
      #1 0x79c951 in apache::thrift::concurrency::PthreadThread::start() thrift/lib/cpp/concurrency/PosixThreadFactory.cpp:108
      #2 0x61e9a0 in apache::thrift::util::ScopedServerThread::start(std::shared_ptr<apache::thrift::server::TServer> const&) thrift/lib/cpp/util/ScopedServerThread.cpp:259
      #3 0x430dd8 in apache::thrift::ScopedServerInterfaceThread::ScopedServerInterfaceThread(std::shared_ptr<apache::thrift::AsyncProcessorFactory>, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&, unsigned short) thrift/lib/cpp2/util/ScopedServerInterfaceThread.cpp:41
      #4 0x415c3b in FetcherHandlerTest_example_pass_Test::TestBody() thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest.cpp:94
      #5 0x99e3b7 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) src/gtest.cc:2364
      #6 0x99e3b7 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) src/gtest.cc:2400
      #7 0x9902e4 in testing::Test::Run() src/gtest.cc:2437
      #8 0x9904b7 in testing::TestInfo::Run() src/gtest.cc:2612
      #9 0x9906d4 in testing::TestInfo::Run() src/gtest.cc:2587
      #10 0x9906d4 in testing::TestCase::Run() src/gtest.cc:2730
      #11 0x991bce in testing::TestCase::Run() src/gtest.cc:4571
      #12 0x991bce in testing::internal::UnitTestImpl::RunAllTests() src/gtest.cc:4602
      #13 0x991e39 in testing::internal::UnitTestImpl::RunAllTests() src/gtest.cc:4519
      #14 0x991e39 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) src/gtest.cc:2364
      #15 0x991e39 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) src/gtest.cc:2400
      #16 0x991e39 in testing::UnitTest::Run() src/gtest.cc:4223
      #17 0x6734e1 in RUN_ALL_TESTS() third-party2/gtest/1.7.0/gcc-4.9-glibc-2.20-fb/e9936bf/include/gtest/gtest.h:2326
      #18 0x67343d in main common/gtest/LightMain.cpp:9
      #19 0x7fe854c630f5 in __libc_start_main (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libc.so.6+0x200f5)
      #20 0x414be5 (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x414be5)

  Thread T2 created by T0 here:
      #0 0x7fe855b5753a in pthread_create (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libasan.so.1+0x2753a)
      #1 0x79c951 in apache::thrift::concurrency::PthreadThread::start() thrift/lib/cpp/concurrency/PosixThreadFactory.cpp:108
      #2 0x4501c7 in apache::thrift::concurrency::ThreadManager::ImplT<folly::LifoSemImpl<std::atomic, folly::Baton<std::atomic> > >::addWorker(unsigned long) thrift/lib/cpp/concurrency/ThreadManager.tcc:161
      #3 0x44f868 in apache::thrift::concurrency::SimpleThreadManager<folly::LifoSemImpl<std::atomic, folly::Baton<std::atomic> > >::start() (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x44f868)
      #4 0x430c96 in apache::thrift::ScopedServerInterfaceThread::ScopedServerInterfaceThread(std::shared_ptr<apache::thrift::AsyncProcessorFactory>, std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > const&, unsigned short) thrift/lib/cpp2/util/ScopedServerInterfaceThread.cpp:34
      #5 0x415c3b in FetcherHandlerTest_example_pass_Test::TestBody() thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest.cpp:94
      #6 0x99e3b7 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) src/gtest.cc:2364
      #7 0x99e3b7 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) src/gtest.cc:2400
      #8 0x9902e4 in testing::Test::Run() src/gtest.cc:2437
      #9 0x9904b7 in testing::TestInfo::Run() src/gtest.cc:2612
      #10 0x9906d4 in testing::TestInfo::Run() src/gtest.cc:2587
      #11 0x9906d4 in testing::TestCase::Run() src/gtest.cc:2730
      #12 0x991bce in testing::TestCase::Run() src/gtest.cc:4571
      #13 0x991bce in testing::internal::UnitTestImpl::RunAllTests() src/gtest.cc:4602
      #14 0x991e39 in testing::internal::UnitTestImpl::RunAllTests() src/gtest.cc:4519
      #15 0x991e39 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) src/gtest.cc:2364
      #16 0x991e39 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) src/gtest.cc:2400
      #17 0x991e39 in testing::UnitTest::Run() src/gtest.cc:4223
      #18 0x6734e1 in RUN_ALL_TESTS() third-party2/gtest/1.7.0/gcc-4.9-glibc-2.20-fb/e9936bf/include/gtest/gtest.h:2326
      #19 0x67343d in main common/gtest/LightMain.cpp:9
      #20 0x7fe854c630f5 in __libc_start_main (/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/lib/libc.so.6+0x200f5)
      #21 0x414be5 (/data/users/meyering/fbsource/fbcode/_build/dbg/thrift/tutorial/cpp/async/fetcher/FetcherHandlerTest+0x414be5)

I'll leave that for a separate diff by someone else.

Reviewed By: alandau

Differential Revision: D2907366

fb-gh-sync-id: 3ba28c9f8361fabdff38faeb923997fd9f41da15
@yuzzjj yuzzjj mentioned this pull request May 6, 2016
facebook-github-bot pushed a commit that referenced this pull request Feb 18, 2017
Summary:
[Thrift] Regression unit-test for recent crash in `THttpParser`.

Filtered crash report, as reproduced by this unit-test, from reverting {D4567032} (9076ff6):

    Note: Google Test filter = THttpClientParserTest.read_encapsulated_status_line
    [==========] Running 1 test from 1 test case.
    [----------] Global test environment set-up.
    [----------] 1 test from THttpClientParserTest
    [ RUN      ] THttpClientParserTest.read_encapsulated_status_line
    ASAN:DEADLYSIGNAL
    =================================================================
    ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
    The signal is caused by a READ memory access.
    Hint: address points to the zero page.
         #1 <binary>                                        strlen
         #2 folly/portability/Constexpr.h:102               unsigned long folly::constexpr_strlen<...>(char const*)
         #3 folly/Range.h:212                               folly::Range<...>::Range<...>(char const*)
         #4 thrift/lib/cpp/util/THttpParser.cpp:208         apache::thrift::util::THttpParser::parseHeader()
         #5 thrift/lib/cpp/util/THttpParser.cpp:87          apache::thrift::util::THttpParser::readDataAvailable(unsigned long)
         #6 thrift/lib/cpp/util/test/THttpParserTest.cpp:20 (anonymous namespace)::write(apache::thrift::util::THttpParser&, folly::Range<...>)
         #7 thrift/lib/cpp/util/test/THttpParserTest.cpp:28 THttpClientParserTest_read_encapsulated_status_line_Test::TestBody()

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV in __GI_strlen
    ABORTING

After reading a complete status line with terminal CRLF, the parser attempts to read the next header line. Since the parser does not see a CRLF from the beginning of the header line yet, it gets a nullptr from `readLine`. Constructing a `StringPiece` from a `nullptr` is a segfault.

Reviewed By: andrewjcg

Differential Revision: D4582453

fbshipit-source-id: 82a21ed6e23083f903e8a2fbf93be01ad149c4ee
facebook-github-bot pushed a commit that referenced this pull request Jun 8, 2018
Summary:
Exposed by UBSAN:
```lang=bash
thrift/compiler/generate/t_json_generator.cc:278:25: runtime error: downcast of address 0x610000000a40 which does not point to an object of type 't_set'
0x610000000a40: note: object is of type '6t_list'
 03 00 80 34  28 b9 74 8a 5f 7f 00 00  58 0a 00 00 00 61 00 00  00 00 00 00 00 00 00 00  00 be be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for '6t_list'
    #0 0x7f5f8b1ec21d in t_json_generator::type_to_spec_args[abi:cxx11](t_type*) thrift/compiler/generate/t_json_generator.cc:278
    #1 0x7f5f8b1ece84 in t_json_generator::print_type(t_type*) thrift/compiler/generate/t_json_generator.cc:293
    #2 0x7f5f8b1f3de0 in t_json_generator::generate_struct(t_struct*) thrift/compiler/generate/t_json_generator.cc:484
    #3 0x7f5f8b1e66aa in t_json_generator::generate_program() thrift/compiler/generate/t_json_generator.cc:161
    #4 0x42ee58 in generate(t_program*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<cha
r, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::
basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) thrift/compiler/main.cc:305
    #5 0x42b88e in main thrift/compiler/main.cc:681
    #6 0x7f5f8734b857 in __libc_start_main /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/csu/../csu/libc-start.c:289
    #7 0x425a28 in _start /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/csu/../sysdeps/x86_64/start.S:118

UndefinedBehaviorSanitizer: dynamic-type-mismatch thrift/compiler/generate/t_json_generator.cc:278:25
```
The fix is inspired by https://github.com/apache/thrift/pull/1222/files

Reviewed By: yfeldblum

Differential Revision: D8154131

fbshipit-source-id: 0ff7d993b87c0fe20652865a89a2bb205dde10e3
facebook-github-bot pushed a commit that referenced this pull request Oct 8, 2019
Summary:
Negating an unsigned number is not mathematically meaningful, hence Visual Studio complains with this warning:
```
thrift\lib\cpp\util\cpp-util-headerswindows#header-mode-symlink-tree-only,headers\thrift\lib\cpp\util\varintutils-inl.h(203): warning C4146: unary minus operator applied to unsigned type, result still unsigned
thrift\lib\cpp\util\cpp-util-headerswindows#header-mode-symlink-tree-only,headers\thrift\lib\cpp\util\varintutils-inl.h(207): warning C4146: unary minus operator applied to unsigned type, result still unsigned
```
We can revise this code to clarify what the zig-zag operation is actually doing. Basically it decides whether to invert all bits depending on the value of `n & 1`

While less compact in C this does not change functionality nor performance on x86_64 or armv7, as confirmed by clang `-O3`, `-Os`, and `-Oz` generating identical instructions. Interestingly though, for aarch64 it generates sequences with one fewer instruction:
```
0000000000000000 <_Z11zigzagToI32j>:
   0:	12000008 	and	w8, w0, #0x1
   4:	4b0803e8 	neg	w8, w8
   8:	4a400500 	eor	w0, w8, w0, lsr #1
   c:	d65f03c0 	ret
-->
0000000000000000 <_Z11zigzagToI32j>:
   0:	13000008 	sbfx	w8, w0, #0, #1
   4:	4a400500 	eor	w0, w8, w0, lsr #1
   8:	d65f03c0 	ret
```

(Again with the identical optimization regardless of `-O3`, `-Os`, or `-Oz`.)

Reviewed By: yfeldblum

Differential Revision: D17789109

fbshipit-source-id: 1cf0977cd9369402051058c4fb0576505eb05970
facebook-github-bot pushed a commit that referenced this pull request Feb 11, 2020
Summary:
Currently if we have "optionals" in thrift_cpp2_options, we will use folly::Optional for optional fields. The motivation of this task is that we want to get rid of "optionals" in thrift_cpp2_options and migrate existing code to use optional_field_ref instead.

As Step #1, we will create new thrift::DeprecatedOptionalField that's compatible with folly::Optional, and can be implicitly casted to each other. After the first step it done, we can codemod the API of thrift::DeprecatedOptionalField to make it identical to optional_field_ref.

This diff created DeprecatedOptionalField struct. I will modify thrift compiler in following diff to generate optional field with this code.

Reviewed By: vitaut

Differential Revision: D19785312

fbshipit-source-id: b5fcaadc9aec8d0a6a223e69bbcb7b565a27210f
facebook-github-bot pushed a commit that referenced this pull request Feb 12, 2020
Summary:
Using the keyword java.swift.type in a thrift IDL,  java-swift codegen will generate Custom types.  This diff is apart of the changes that remove reflection done by swift-codec. These custom types will replace the types in the read0 and write0 methods which serialize and deserialize the data.

```
struct TypeRemapped {
  1: map<i64, string>
  (java.swift.type =
  "it.unimi.dsi.fastutil.longs.Long2ObjectArrayMap<String>") lsMap,
 2: binary (java.swift.type = "java.nio.ByteBuffer" ) byteBufferForBinary,
}
```

Example #1: The map<i64, string> (Hashmap) will be replaced by Long2ObjectArrayMap
Example #2:  binary will be replaced by ByteBuffer.

Reviewed By: stevegury

Differential Revision: D19465263

fbshipit-source-id: e388f561105de7d862962243c9d590cdc4a8a297
facebook-github-bot pushed a commit that referenced this pull request Feb 9, 2021
Summary:
Found issue:

```
FAILED: fbzmq/zmq_monitor_client_test
: && /usr/bin/c++  -Wall -Wextra -Werror -Wno-noexcept-type -Wno-deprecated-declarations -O2 -g -DNDEBUG  -rdynamic fbzmq/CMakeFiles/zmq_monitor_client_test.dir/service/monitor/tests/ZmqMonitorClientTest.cpp.o  -o fbzmq/zmq_monitor_client_test  -Wl,-rpath,/data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/libzmq-WYNUZ5VYcelOAY3uV_bjnHhzwQrgoK4MvHyCMsp1MuM/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/zstd-nu72lnvEO9fXOOi7ZDqer47syM_R4CVWONQAAxQ0V5g/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/snappy-w4Hybv-wJ190T-fglHVpnK3xq1CxUGT9RtVGDA7QpaM/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/libsodium-e0bvqBDnJ4y9whbWaG6aIRWX0Xb17alEHHIoSi2Hz9c/lib fbzmq/libfbzmq.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest_main.a fbzmq/libmonitor_cpp2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib/libglog.so /data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib/libgflags.so.2.2.2 /data/sandcastle/temp/fbcode_builder_getdeps/installed/libzmq-WYNUZ5VYcelOAY3uV_bjnHhzwQrgoK4MvHyCMsp1MuM/lib/libzmq.so -lpthread /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftcpp2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftfrozen2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftmetadata.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libasync.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libtransport.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librpcmetadata.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libconcurrency.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthrift-core.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/wangle/lib/libwangle.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fizz/lib/libfizz.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/folly/lib/libfolly.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fmt-XC_RDlIh_QfDiWVKV15MrgHVykUKaWg5dp-5MlmMLoc/lib/libfmt.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_filesystem.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_program_options.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_regex.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_system.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_thread.a -pthread /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_chrono.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_date_time.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_atomic.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/libevent-SfVb6EMfp14dO1ACJpoFHGVUEsS5yLPksnxEKjSa2mw/lib/libevent.a -lz -lbz2 -llzma /data/sandcastle/temp/fbcode_builder_getdeps/installed/lz4-EcyPuwYsuHakUlA-kWxer8wHvXjm9kQFsGAS-N5bd98/lib/liblz4.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/zstd-nu72lnvEO9fXOOi7ZDqer47syM_R4CVWONQAAxQ0V5g/lib/libzstd.so /data/sandcastle/temp/fbcode_builder_getdeps/installed/snappy-w4Hybv-wJ190T-fglHVpnK3xq1CxUGT9RtVGDA7QpaM/lib/libsnappy.so -ldwarf -Wl,-Bstatic -liberty -Wl,-Bdynamic -lsodium -lunwind /data/sandcastle/temp/fbcode_builder_getdeps/installed/double-conversion-y46-Q4-Wds7DK27aDIxuW79GtOdq8ODZK6B7jzYHlhc/lib/libdouble-conversion.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib/libgflags.so.2.2.2 /data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib/libglog.so -lssl -lcrypto -ldl /data/sandcastle/temp/fbcode_builder_getdeps/installed/libsodium-e0bvqBDnJ4y9whbWaG6aIRWX0Xb17alEHHIoSi2Hz9c/lib/libsodium.so -lrt /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_context.a -ldl /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest.a -lpthread && :
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::RocketUpgradeAsyncClient::upgradeToRocketImpl(apache::thrift::RpcOptions const&, std::shared_ptr<apache::thrift::detail::ac::ClientRequestContext>, std::unique_ptr<apache::thrift::RequestClientCallback, apache::thrift::RequestClientCallback::RequestClientCallbackDeleter>)':
/data/sandcastle/temp/fbcode_builder_getdeps/build/fbthrift/thrift/lib/thrift/gen-cpp2/RocketUpgradeAsyncClient.cpp:61: undefined reference to `apache::thrift::detail::ac::throw_app_exn(char const*)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::preprocessSendT<apache::thrift::BinaryProtocolWriter>(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack&, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>)::{lambda()#1}::operator()() const':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/async/RequestChannel.h:332: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::preprocessSendT<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack&, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>)::{lambda()#1}::operator()() const':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/async/RequestChannel.h:332: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::BinaryProtocolReader, apache::thrift::ThriftPresult<true> >(char const*, apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult<true>&)':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/GeneratedCodeHelper.h:503: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::CompactProtocolReader, apache::thrift::ThriftPresult<true> >(char const*, apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult<true>&)':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/GeneratedCodeHelper.h:503: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'

FAILED: fbzmq/zmq_monitor_test
: && /usr/bin/c++  -Wall -Wextra -Werror -Wno-noexcept-type -Wno-deprecated-declarations -O2 -g -DNDEBUG  -rdynamic fbzmq/CMakeFiles/zmq_monitor_test.dir/service/monitor/tests/ZmqMonitorTest.cpp.o  -o fbzmq/zmq_monitor_test  -Wl,-rpath,/data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/libzmq-WYNUZ5VYcelOAY3uV_bjnHhzwQrgoK4MvHyCMsp1MuM/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/zstd-nu72lnvEO9fXOOi7ZDqer47syM_R4CVWONQAAxQ0V5g/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/snappy-w4Hybv-wJ190T-fglHVpnK3xq1CxUGT9RtVGDA7QpaM/lib:/data/sandcastle/temp/fbcode_builder_getdeps/installed/libsodium-e0bvqBDnJ4y9whbWaG6aIRWX0Xb17alEHHIoSi2Hz9c/lib fbzmq/libfbzmq.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest_main.a fbzmq/libmonitor_cpp2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib/libglog.so /data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib/libgflags.so.2.2.2 /data/sandcastle/temp/fbcode_builder_getdeps/installed/libzmq-WYNUZ5VYcelOAY3uV_bjnHhzwQrgoK4MvHyCMsp1MuM/lib/libzmq.so -lpthread /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftcpp2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftfrozen2.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftmetadata.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libasync.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libtransport.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librpcmetadata.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libconcurrency.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/libthrift-core.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/wangle/lib/libwangle.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fizz/lib/libfizz.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/folly/lib/libfolly.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/fmt-XC_RDlIh_QfDiWVKV15MrgHVykUKaWg5dp-5MlmMLoc/lib/libfmt.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_filesystem.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_program_options.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_regex.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_system.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_thread.a -pthread /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_chrono.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_date_time.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_atomic.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/libevent-SfVb6EMfp14dO1ACJpoFHGVUEsS5yLPksnxEKjSa2mw/lib/libevent.a -lz -lbz2 -llzma /data/sandcastle/temp/fbcode_builder_getdeps/installed/lz4-EcyPuwYsuHakUlA-kWxer8wHvXjm9kQFsGAS-N5bd98/lib/liblz4.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/zstd-nu72lnvEO9fXOOi7ZDqer47syM_R4CVWONQAAxQ0V5g/lib/libzstd.so /data/sandcastle/temp/fbcode_builder_getdeps/installed/snappy-w4Hybv-wJ190T-fglHVpnK3xq1CxUGT9RtVGDA7QpaM/lib/libsnappy.so -ldwarf -Wl,-Bstatic -liberty -Wl,-Bdynamic -lsodium -lunwind /data/sandcastle/temp/fbcode_builder_getdeps/installed/double-conversion-y46-Q4-Wds7DK27aDIxuW79GtOdq8ODZK6B7jzYHlhc/lib/libdouble-conversion.a /data/sandcastle/temp/fbcode_builder_getdeps/installed/gflags-xgCB_7eImt1ED3 (7a2fec883e641ecfe9c69aea83f3847ef7464698)QZZ0odZuKnfiDHhQTSb1BAKFNIuSE/lib/libgflags.so.2.2.2 /data/sandcastle/temp/fbcode_builder_getdeps/installed/glog-jbbNcEe1kvSNQWMMAJS0uF4p5E6ekVbf0Gcrgys6dDY/lib/libglog.so -lssl -lcrypto -ldl /data/sandcastle/temp/fbcode_builder_getdeps/installed/libsodium-e0bvqBDnJ4y9whbWaG6aIRWX0Xb17alEHHIoSi2Hz9c/lib/libsodium.so -lrt /data/sandcastle/temp/fbcode_builder_getdeps/installed/boost-YTxtJVn66eoEksgVRyTxbaq8DPPKh10XEOf_xFT94CY/lib/libboost_context.a -ldl /data/sandcastle/temp/fbcode_builder_getdeps/installed/googletest-C1jJnbUgB2bWMOXX9xwhVXibFypWvMRmxh6FuXDd4Hc/lib/libgtest.a -lpthread && :
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::RocketUpgradeAsyncClient::upgradeToRocketImpl(apache::thrift::RpcOptions const&, std::shared_ptr<apache::thrift::detail::ac::ClientRequestContext>, std::unique_ptr<apache::thrift::RequestClientCallback, apache::thrift::RequestClientCallback::RequestClientCallbackDeleter>)':
/data/sandcastle/temp/fbcode_builder_getdeps/build/fbthrift/thrift/lib/thrift/gen-cpp2/RocketUpgradeAsyncClient.cpp:61: undefined reference to `apache::thrift::detail::ac::throw_app_exn(char const*)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::preprocessSendT<apache::thrift::BinaryProtocolWriter>(apache::thrift::BinaryProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack&, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::BinaryProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::BinaryProtocolWriter*)>)::{lambda()#1}::operator()() const':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/async/RequestChannel.h:332: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `apache::thrift::preprocessSendT<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*, apache::thrift::RpcOptions const&, apache::thrift::ContextStack&, apache::thrift::transport::THeader&, folly::Range<char const*>, folly::FunctionRef<void (apache::thrift::CompactProtocolWriter*)>, folly::FunctionRef<unsigned long (apache::thrift::CompactProtocolWriter*)>)::{lambda()#1}::operator()() const':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/async/RequestChannel.h:332: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::BinaryProtocolReader, apache::thrift::ThriftPresult<true> >(char const*, apache::thrift::BinaryProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult<true>&)':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/GeneratedCodeHelper.h:503: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'
/data/sandcastle/temp/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(RocketUpgradeAsyncClient.cpp.o): In function `folly::exception_wrapper apache::thrift::detail::ac::recv_wrapped_helper<apache::thrift::CompactProtocolReader, apache::thrift::ThriftPresult<true> >(char const*, apache::thrift::CompactProtocolReader*, apache::thrift::ClientReceiveState&, apache::thrift::ThriftPresult<true>&)':
/data/sandcastle/temp/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/GeneratedCodeHelper.h:503: undefined reference to `apache::thrift::checksum::crc32c(folly::IOBuf const&, unsigned long)'

FAILED: fbzmq/socket_test
: && /usr/bin/c++  -Wall -Wextra -Werror -Wno-noexcept-type -Wno-deprecated-declarations -O2 -g -DNDEBUG  -rdynamic fbzmq/CMakeFiles/socket_test.dir/zmq/tests/SocketTest.cpp.o  -o fbzmq/socket_test  -Wl,-rpath,/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/glog-Rqbf3AQfnM1pIMTNO0VZH5L2gvst-R0_2ena0nqk1mo/lib64:/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/gflags-vO_pvTYzLN9SWkXURwa6cRaxp70Hj86KE0DyrQM5IKk/lib:/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/libzmq-_8z7dmP07W_b-LvrcUAIkivGF6Uu1xCgAJ_kqB09Jck/lib:/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/zstd-ZJsxbZf68uCJ7Vz1We8SO6pkwbt1oc55C0-EhUBgxOs/lib64:/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/snappy-5hvYh82hARhvyeUX8hbN6NrNzgBgOhd7IyCR-eBmhWQ/lib64:/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/libsodium--JQk_Aex__Vn27x5ju_-noWQypZ6PNxS8ye8XzY1tMc/lib fbzmq/libfbzmq.a fbzmq/libtest_cpp2.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/folly/lib/libfolly.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/googletest-roLvBDEwbDYQx1Gp6obpa7FslX4eYR3oJNYwtIq5opM/lib64/libgtest.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/googletest-roLvBDEwbDYQx1Gp6obpa7FslX4eYR3oJNYwtIq5opM/lib64/libgtest_main.a fbzmq/libmonitor_cpp2.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/glog-Rqbf3AQfnM1pIMTNO0VZH5L2gvst-R0_2ena0nqk1mo/lib64/libglog.so /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/gflags-vO_pvTYzLN9SWkXURwa6cRaxp70Hj86KE0DyrQM5IKk/lib/libgflags.so.2.2.2 /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/libzmq-_8z7dmP07W_b-LvrcUAIkivGF6Uu1xCgAJ_kqB09Jck/lib/libzmq.so -lpthread -ldl /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftcpp2.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftfrozen2.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftmetadata.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthriftprotocol.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libasync.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libtransport.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/librpcmetadata.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libconcurrency.a -lz /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/libthrift-core.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/wangle/lib/libwangle.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fizz/lib/libfizz.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/folly/lib/libfolly.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_context.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fmt-HAn4S6KilDCf4tWqBldG1j0n4wnCVYKILXKX1uBTOek/lib64/libfmt.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_filesystem.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_program_options.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_regex.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_system.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_thread.a -pthread /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_chrono.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_date_time.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/boost-3qPc7TOCRy4bo035RXQyi7qfOlGBF1hg4_yymXkTYqU/lib/libboost_atomic.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/libevent-hsAi2sbhcjnmjkK_viQYSSVmrIpifomzL3-qSeLiZ_o/lib/libevent.a -lz /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/lz4-m5T8aYA0A-XwRjMYcbbpLy3VCcAybYwkBiI1PA_8fI8/lib64/liblz4.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/zstd-ZJsxbZf68uCJ7Vz1We8SO6pkwbt1oc55C0-EhUBgxOs/lib64/libzstd.so /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/snappy-5hvYh82hARhvyeUX8hbN6NrNzgBgOhd7IyCR-eBmhWQ/lib64/libsnappy.so -laio /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/double-conversion-HJC2WBX_7KWaN3X3W1Zheqtf239Y0g7aeVN1MaYQm6Y/lib/libdouble-conversion.a /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/gflags-vO_pvTYzLN9SWkXURwa6cRaxp70Hj86KE0DyrQM5IKk/lib/libgflags.so.2.2.2 /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/glog-Rqbf3AQfnM1pIMTNO0VZH5L2gvst-R0_2ena0nqk1mo/lib64/libglog.so -lssl -lcrypto -ldl /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/libsodium--JQk_Aex__Vn27x5ju_-noWQypZ6PNxS8ye8XzY1tMc/lib/libsodium.so -lrt /data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/googletest-roLvBDEwbDYQx1Gp6obpa7FslX4eYR3oJNYwtIq5opM/lib64/libgtest.a -lpthread && :
/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/installed/fbthrift/lib/librocketupgrade.a(GeneratedCodeHelper.cpp.o): In function `void apache::thrift::RequestsRegistry::Deleter::operator()<apache::thrift::ResponseChannelRequest>(apache::thrift::ResponseChannelRequest*)':
/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/server/RequestsRegistry.h:177: undefined reference to `apache::thrift::RequestsRegistry::moveToFinishedList(apache::thrift::RequestsRegistry::DebugStub&)'
/data/users/yixianj/scratch/dataZusersZyixianjZfbsource/fbcode_builder_getdeps/shipit/fbthrift/thrift/lib/cpp2/server/RequestsRegistry.h:181: undefined reference to `apache::thrift::RequestsRegistry::DebugStub::decRef()'
```

Reviewed By: jmswen

Differential Revision: D26318703

fbshipit-source-id: 5ac5b5a3ffec5c7a1293edcc7d44cbd9b1e1e09b
facebook-github-bot pushed a commit that referenced this pull request Mar 9, 2021
Summary:
Add accessors for mixed-in fields in py3.

There're two options:
1. Reuse the cpp accessors and just wrap them.
2. Reimplement the nested field accessing in py3.

Given the spirit of thrift-py3 wrapping cpp2, this diff went with option #1.
It also make it possible for regular field accessors and mixin field accessors to share most code, see the following diff.

Reviewed By: Mizuchi

Differential Revision: D26840253

fbshipit-source-id: 6a55e19cd3a777babea7759eb959144079d76aca
facebook-github-bot pushed a commit that referenced this pull request Aug 5, 2021
Summary:
`AsyncTransport::UniquePtr` is a resource managing type that manages the lifetime
of the underlying socket. It is declared as a member variable of `RocketServerConnection`,
which means that the implicit object destructor, which runs after the user defined `RocketServerConnection::~RocketServerConnection`,
will take care of destroying the object.

Manually destroying the object in the user defined destructor is not only unnecessary, it is incorrect. In particular, `ThriftRocketServerHandler::frameHandler_` borrows the socket_ via a raw pointer. `frameHandler_` is declared after the `socket_`, so under normal destruction ordering this borrow is valid. However, due to the fact that `~RocketServerConnection` manually destroys this, it is possible to end up with a use after free:

```
(gdb) bt
#0  0x00007f8c1f6574b8 in folly::DecoratedAsyncTransportWrapper<folly::AsyncTransport>::getPeerCertificate() const () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#1  0x00007f8c11146b4e in apache::thrift::Cpp2ConnContext::getPeerCommonName[abi:cxx11]() const () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/CppServerWrapper.so
#2  0x00007f8c1114690b in apache::thrift::CppContextData::copyContextContents(apache::thrift::Cpp2ConnContext*) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/CppServerWrapper.so
#3  0x00007f8c1114c2d1 in CppServerEventHandler::callPythonHandler(apache::thrift::server::TConnectionContext*, char const*) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/CppServerWrapper.so
#4  0x00007f8c1f6684b5 in apache::thrift::rocket::ThriftRocketServerHandler::~ThriftRocketServerHandler() () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#5  0x00007f8c1f972937 in non-virtual thunk to apache::thrift::rocket::RocketServerConnection::~RocketServerConnection() () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#6  0x00007f8c1f97a4fe in apache::thrift::rocket::RocketServerConnection::WriteBatcher::runLoopCallback() () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#7  0x00007f8c202d6f45 in folly::EventBase::loopBody(int, bool) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#8  0x00007f8c202d81ed in folly::EventBase::loopForever() () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#9  0x00007f8c2026abe4 in folly::IOThreadPoolExecutor::threadRun(std::shared_ptr<folly::ThreadPoolExecutor::Thread>) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#10 0x00007f8c202d2c74 in void std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#11 0x00007f8c202d2bc4 in void folly::detail::function::FunctionTraits<void ()>::callBig<std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)> >(folly::detail::function::Data&) () from /data/users/mingtao/tmp/thrift_getx509_coredump/par_unpack/sos/libomnibus.so
#12 0x00007f8c84002801 in std::execute_native_thread_routine (__p=0x7f8bfd03aee0) at ../../../.././libstdc++-v3/src/c++11/thread.cc:80
#13 0x00007f8c844ac20c in start_thread (arg=0x7f8bd6dff700) at pthread_create.c:479
#14 0x00007f8c8428881f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
```

This diff removes the manual socket reset in `RocketServerHandler` and replaces it with an explicit call to `socket->closeNow()`.

Reviewed By: andriigrynenko

Differential Revision: D30074941

fbshipit-source-id: af9ea2386cf864683eb843a8c1ca0128d7d8e467
facebook-github-bot pushed a commit that referenced this pull request Oct 22, 2021
Summary:
Currently if there is negative id in thrift struct, the generated thrift python (not py3) code is wrong.

e.g. for thrift struct

```
struct NegativeId {
  -1: i32 field1 = 1;
  -2: i32 field2 = 2;
  1: i32 field3 = 3;
}
```

This is snippet of generated code

```
NegativeId.thrift_spec = (
  (-2, TType.I32, 'field2', None, 2, 2, ), # -2
  (-1, TType.I32, 'field1', None, 1, 2, ), # -1
  None, # 0
  (1, TType.I32, 'field3', None, 3, 2, ), # 1
)

def NegativeId__init__(self, field1=NegativeId.thrift_spec[-1][4], field2=NegativeId.thrift_spec[-2][4], field3=NegativeId.thrift_spec[1][4],):
  self.field1 = field1
  self.field2 = field2
  self.field3 = field3
```

First, we generate `NegativeId.thrift_spec` tuple, then use `NegativeId.thrift_spec[Id]` to read the information for each field.

If there is no negative field, this is fine. However this is wrong for negative field since id will be shifted by `2` in thrift_spec (e.g. `NegativeId.thrift_spec[3]` is field #1).

This diff fixed the issue by adding offset to field id when getting information from `thrift_sepc`, e.g.

```
def NegativeId__init__(self, field1=NegativeId.thrift_spec[1][4], field2=NegativeId.thrift_spec[0][4], field3=NegativeId.thrift_spec[3][4],):
  self.field1 = field1
  self.field2 = field2
  self.field3 = field3
```

Reviewed By: nanshu

Differential Revision: D31670081

fbshipit-source-id: 539bfff41dc656c8e155af439077af379834acaa
facebook-github-bot pushed a commit that referenced this pull request Apr 18, 2022
Summary:
Fix `TMemoryBuffer::ensureCanWrite` for the empty buffer. Previously there was a UB because null pointer wasn't handled properly:

```
thrift/lib/cpp/transport/TBufferTransports.cpp:458:10: runtime error: applying non-zero offset 107271103209344 to null pointer
    #0 0x7f90a738cc31 in apache::thrift::transport::TMemoryBuffer::ensureCanWrite(unsigned int) thrift/lib/cpp/transport/TBufferTransports.cpp:458
    #1 0x7f90a7769b4e in apache::thrift::transport::TMemoryBuffer::getWritePtr(unsigned int) thrift/lib/cpp/transport/TBufferTransports.h:809
    #2 0x7f90a7769ae0 in apache::thrift::async::detail::TFramedACReadState::getReadBuffer(void**, unsigned long*) thrift/lib/cpp/async/TFramedAsyncChannel.cpp:
86
    #3 0x30909b in apache::thrift::async::TStreamAsyncChannel<apache::thrift::async::detail::TFramedACWriteRequest, apache::thrift::async::detail::TFramedACRea
dState>::getReadBuffer(void**, unsigned long*) thrift/lib/cpp/async/TStreamAsyncChannel-inl.h:260
    #4 0x7f90a767028d in folly::AsyncSocket::prepareReadBuffer(void**, unsigned long*) folly/io/async/AsyncSocket.cpp:2517
    #5 0x7f90a7677cf2 in folly::AsyncSocket::processNormalRead() folly/io/async/AsyncSocket.cpp:2869
    #6 0x7f90a767a1f4 in folly::AsyncSocket::handleRead() folly/io/async/AsyncSocket.cpp:2977
    #7 0x7f90a766d89a in folly::AsyncSocket::ioReady(unsigned short) folly/io/async/AsyncSocket.cpp:2398
    #8 0x7f90a76a442a in folly::AsyncSocket::IoHandler::handlerReady(unsigned short) folly/io/async/AsyncSocket.h:1294
    #9 0x7f90a75998d3 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:159
    #10 0x7f90a6943608 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390:5
    #11 0x7f90a6943608 in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532:4
    #12 0x7f90a754aa23 in (anonymous namespace)::EventBaseBackend::eb_event_base_loop(int) folly/io/async/EventBase.cpp:74
    #13 0x7f90a7538e16 in folly::EventBase::loopBody(int, bool) folly/io/async/EventBase.cpp:381
    #14 0x7f90a75377f2 in folly::EventBase::loop() folly/io/async/EventBase.cpp:305
    #15 0x33722c in SocketPairTest<apache::thrift::async::TFramedAsyncChannel>::loop(unsigned int) thrift/lib/cpp/test/TAsyncChannelTest.cpp:506
    #16 0x3043a3 in SocketPairTest<apache::thrift::async::TFramedAsyncChannel>::runWithTimeout(unsigned int) thrift/lib/cpp/test/TAsyncChannelTest.cpp:513
    #17 0x3035f9 in SocketPairTest<apache::thrift::async::TFramedAsyncChannel>::run() thrift/lib/cpp/test/TAsyncChannelTest.cpp:509
    #18 0x2f6766 in TAsyncChannelTest_TestMultiSendRecvFramedQueued_Test::TestBody() thrift/lib/cpp/test/TAsyncChannelTest.cpp:729
    #19 0x7f90a6cc9fbf in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char c
onst*) /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2607:27
    #20 0x7f90a6cc9fbf in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char cons
t*) /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2643:52
    #21 0x7f90a6cb9ad5 in testing::Test::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2682:50
    #22 0x7f90a6cb9ad5 in testing::Test::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2672:6
    #23 0x7f90a6cb9c64 in testing::TestInfo::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2861:14
    #24 0x7f90a6cb9c64 in testing::TestInfo::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2833:6
    #25 0x7f90a6cba321 in testing::TestSuite::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:3015:31
    #26 0x7f90a6cba321 in testing::TestSuite::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2993:6
    #27 0x7f90a6cbab1e in testing::internal::UnitTestImpl::RunAllTests() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:5
855:47
    #28 0x7f90a6cb9d2c in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl
*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2607:27
    #29 0x7f90a6cb9d2c in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*,
bool (testing::internal::UnitTestImpl::*)(), char const*) /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:2643:52
    #30 0x7f90a6cb9d2c in testing::UnitTest::Run() /home/engshare/third-party2/googletest/1.11.0/src/googletest/googletest/src/gtest.cc:5438:55
    #31 0x7f90a75dbae0 in RUN_ALL_TESTS() third-party-buck/platform010/build/googletest/include/gtest/gtest.h:2490
    #32 0x7f90a75db758 in main common/gtest/LightMain.cpp:20
    #33 0x7f90a4e9b656 in __libc_start_call_main /home/engshare/third-party2/glibc/2.34/src/glibc-2.34/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #34 0x7f90a4e9b717 in __libc_start_main_impl /home/engshare/third-party2/glibc/2.34/src/glibc-2.34/csu/../csu/libc-start.c:409:3
    #35 0x2ecbe0 in _start /home/engshare/third-party2/glibc/2.34/src/glibc-2.34/csu/../sysdeps/x86_64/start.S:116
```

Reviewed By: iahs

Differential Revision: D35723595

fbshipit-source-id: 3b0f3104a0e4551a94fcb45f2ccadcca85b699cd
facebook-github-bot pushed a commit that referenced this pull request May 5, 2023
Summary:
Generated C++ Thrift code uses method names in a couple formats:
1. `<service name>.[<interaction name>.]<method name>` when configuring context
stacks, both on the [client](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/service_async_client_cpp/function_implementation.mustache#L85-L89) and the [server](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/service_tcc/process_and_return.mustache#L77).
2. [`[<interaction name>.]<method name>`](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/common/function_name.mustache#L17) for the [response envelope](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/service_tcc/process_and_return.mustache#L293) (if
applicable), the [read hook](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/service_tcc/process_and_return.mustache#L82), and the [write hook](https://github.com/facebook/fbthrift/blob/5d86ee0072e56c64bfba8061e0f790fd3f17e362/thrift/compiler/generate/templates/cpp2/service_tcc/process_and_return.mustache#L231).

Currently, Rust uses `<interaction name or service name>.<method name>` for both
of the above. The decision to use the interaction name or service name is based
on whether the method is part of an interaction - if it is, the interaction name
is used, otherwise the service name is used.

This diff updates Rust to be consistent with C++ in #1 and #2.

Reviewed By: jsgf

Differential Revision: D45322484

fbshipit-source-id: 38e2604921e69208cdcb983e8def71954b212b41
facebook-github-bot pushed a commit that referenced this pull request Jul 19, 2024
Summary:
Previously, every client trait in a service inheritance chain would contain a separate `.transport()` trait method for accessing the underlying fbthrift transport (e.g. ServiceRouterChannel).

If we have `service DerivedService extends BaseService` then:

```lang=rust
pub trait BaseServiceExt<T>
where
    T: Transport,
{
    ...
    fn transport(&self) -> &T {
        &self.transport
    }
}

pub trait DerivedServiceExt<T>: BaseServiceExt<T>
where
    T: Transport,
{
    ...
    fn transport(&self) -> &T {
        self.parent.transport()
    }
}
```

This causes friction because calls to `.transport()` must be disambiguated with which of these **identical** `transport` methods they want to call.

Various forms of calling `transport`:

```lang=rust
let channel = SRChannelBuilder::from_service_name(fb, "...")
    .unwrap()
    .with_client_params(srclient::ClientParams::new().with_localhost_only(port))
    .build_channel()
    .unwrap();

let client = DerivedServiceImpl::<CompactProtocol<ServiceRouterChannel>, _>::new(channel);

// inherent method
let _ = client.transport();

// statically dispatched trait method
let _ = <BaseServiceExt<_>>::transport(&client);

// dynamically dispatched trait method
let _ = (&client as &dyn DerivedServiceExt<_>).transport();

// dynamically dispatched trait method from supertrait
let _ = (&client as &dyn BaseServiceExt<_>).transport();
let _ = <AsRef<dyn BaseServiceExt<_>>>::as_ref(&client).transport();
```

Previously, calling `.transport()` on `dyn DerivedServiceExt` would be ambiguous because there are 2 such trait methods, and `dyn DerivedServiceExt` implements both traits.

```lang=text,counterexample
error[E0034]: multiple applicable items in scope
   --> path/to/repro.rs:357:52
    |
357 |     let _ = (&client as &dyn DerivedServiceExt<_>).transport();
    |                                                    ^^^^^^^^^ multiple `transport` found
    |
note: candidate #1 is defined in the trait `DerivedServiceExt`
   --> path/to/repro.rs:2416:5
note: candidate #2 is defined in the trait `BaseServiceExt`
   --> path/to/repro.rs:913:5
help: disambiguate the method for candidate #1
    |
357 |     let _ = DerivedServiceExt::transport(&(&client as &dyn DerivedServiceExt<_>));
    |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
    |
357 |     let _ = BaseServiceExt::transport(&(&client as &dyn DerivedServiceExt<_>));
    |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

This diff removes the `transport` trait method of any service that extends another service, leaving every service with exactly one `transport` method among its client trait hierarchy.

Reviewed By: diliop

Differential Revision: D59937771

fbshipit-source-id: af10081d19fa7ce3748c9aadfd9d1a50d43e35a7
facebook-github-bot pushed a commit that referenced this pull request Nov 5, 2024
Summary:
Currently `InternalPriorityRequestPile` implements prioritization for existing interactions by creating two `RoundRobinRequestPile`s, one for new interactions and non-interaction requests and another for existing interactions, always preferring to dequeue from the existing interaction RequestPile first.

This results in two problems:
1. When using priorities within `RoundRobinRequestPile` itself (eg. using `ThreadManagerType::PRIORITY_QUEUE`), **all** interaction continuations would be prioritized over non-continuations, even if there is a regular request with higher priority enqueued. For example, if there is a regular request with HIGH priority and an interaction continuation with BEST_EFFORT priority, the continuation would be executed first.
2. DLS doesn't use `InternalPriorityRequestPile`. If we simply wrap the DLS `RoundRobinRequestPile` inside an `InternalPriorityRequestPile` we end up with the same problem as #1.

To fix this, we move the logic of internal priority within `RoundRobinRequestPile` itself by doubling the number of priorities specified if the service is using interactions.

Pending follow ups:
- Update DLS to use `addInternalPriorities`
- Delete `InternalPriorityRequestPile`

Reviewed By: sazonovkirill

Differential Revision: D64848745

fbshipit-source-id: 3df52be2b20ced1c4355696756ae1e5953ce4878
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.

2 participants