Skip to content

Update README.md#1

Closed
ajtulloch wants to merge 1 commit into
facebook:masterfrom
ajtulloch:patch-1
Closed

Update README.md#1
ajtulloch wants to merge 1 commit into
facebook:masterfrom
ajtulloch:patch-1

Conversation

@ajtulloch

Copy link
Copy Markdown

No description provided.

bugok pushed a commit to facebook/folly that referenced this pull request Jun 3, 2015
Summary:
facebook/wangle#1

Test Plan: reads better

Reviewed By: jsedgwick@fb.com

Subscribers: fugalh, exa, folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D2111498

Signature: t1:2111498:1432927058:1f14b38faa324d0bdef9421ae5592244a6b78928
@lixiangnlp lixiangnlp mentioned this pull request Nov 10, 2015
@djwatson

djwatson commented Dec 1, 2015

Copy link
Copy Markdown

merged

@djwatson djwatson closed this Dec 1, 2015
ghost pushed a commit that referenced this pull request Aug 17, 2016
Summary:
```
      ☢ wangle/service:ServiceTest - Wangle.ClientServerTest 1.799s (FATAL)
Failed to find test summary. This test binary may have crashed mid-run. Full output follows:
Note: Google Test filter = Wangle.ClientServerTest
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Wangle
[ RUN      ] Wangle.ClientServerTest
=================================================================
==2396362==ERROR: AddressSanitizer: heap-use-after-free on address 0x611000000568 at pc 0x000000481dfc bp 0x7fff7d9c2eb0 sp 0x7fff7d9c2ea8
=== How to use this, how to get the raw stack trace, and more: fburl.com/ASAN ===
W0812 19:22:04.903192 2396422 HandlerContext-inl.h:177] readEOF reached end of pipeline
READ of size 8 at 0x611000000568 thread T0
     #2 wangle/channel/Pipeline-inl.h:72         wangle::PipelineBase& wangle::PipelineBase::removeHelper<...>(wangle::ClientDispatcherBase<...>*, bool)
     #3 wangle/channel/Pipeline-inl.h:97         wangle::PipelineBase& wangle::PipelineBase::remove<...>(wangle::ClientDispatcherBase<...>*)
     #4 wangle/service/ClientDispatcher.h:27     wangle::ClientDispatcherBase<...>::~ClientDispatcherBase()
     #5 wangle/service/ClientDispatcher.h:63     wangle::SerialClientDispatcher<...>::~SerialClientDispatcher()
     #6 wangle/service/ServiceTest.cpp:89        wangle::ClientServiceFactory<...>::ClientService::~ClientService()
    #13 folly/Traits.h:279                       std::shared_ptr<...>::~shared_ptr()
    #14 wangle/service/ServiceTest.cpp:135       wangle::Wangle_ClientServerTest_Test::TestBody()
    #25 common/gtest/LightMain.cpp:9             main

0x611000000568 is located 40 bytes inside of 200-byte region [0x611000000540,0x611000000608)
freed by thread T0 here:
     #0 ServiceTest+0x59d790                     operator delete(void*)
     #1 wangle/channel/Pipeline-inl.h:26         wangle::Pipeline<...>::~Pipeline()
     #6 folly/Traits.h:279                       std::shared_ptr<...>::~shared_ptr()
     #7 wangle/bootstrap/BaseClientBootstrap.h:31 wangle::BaseClientBootstrap<...>::~BaseClientBootstrap()
     #8 wangle/bootstrap/ClientBootstrap.h:100   wangle::ClientBootstrap<...>::~ClientBootstrap()
    #16 wangle/service/ServiceTest.cpp:134       wangle::Wangle_ClientServerTest_Test::TestBody()
    #27 common/gtest/LightMain.cpp:9             main

previously allocated by thread T0 here:
     #0 ServiceTest+0x59d150                     operator new(unsigned long)
     #1 wangle/channel/Pipeline.h:167            wangle::Pipeline<...>::create()
     #2 wangle/service/ServiceTest.cpp:77        wangle::ClientPipelineFactory<...>::newPipeline(std::shared_ptr<...>)
     #3 wangle/bootstrap/BaseClientBootstrap.h:59 wangle::BaseClientBootstrap<...>::makePipeline(std::shared_ptr<...>)
     #4 wangle/bootstrap/ClientBootstrap.h:94    wangle::ClientBootstrap<...>::connect(folly::SocketAddress const&, std::chrono::duration<...>)::{lambda()#1}::operator()() const
     #5 folly/Function.h:290                     void folly::detail::function::FunctionTraits<...>::callSmall<...>(folly::detail::function::Data&)
     #6 folly/async/EventBase.cpp:629            folly::detail::function::FunctionTraits<...>::operator()()
     #8 wangle/bootstrap/ClientBootstrap.h:76    wangle::ClientBootstrap<...>::connect(folly::SocketAddress const&, std::chrono::duration<...>)
     #9 wangle/service/ServiceTest.cpp:123       wangle::Wangle_ClientServerTest_Test::TestBody()
    #20 common/gtest/LightMain.cpp:9             main

: AddressSanitizer: heap-use-after-free third-party-buck/gcc-4.9-glibc-2.20-fb/build/libgcc/include/c++/trunk/bits/stl_vector.h:267 in std::vector<std::shared_ptr<wangle::PipelineContext>, std::allocator<std::shared_ptr<wangle::PipelineContext> > >::_M_is_valid() const
Shadow bytes around the buggy address:
  0x0c227fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c227fff80a0: fa fa fa fa fa fa fa fa fd fd fd fd fd[fd]fd fd
  0x0c227fff80b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c227fff80c0: fd fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff80d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c227fff80e0: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa
  0x0c227fff80f0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==2396362==ABORTING
      ✓ wangle/service:ServiceTest - main 0.000s (PASS)
Summary (total time 1.91s):
  PASS: 9
  FAIL: 0
  SKIP: 0
  FATAL: 1
    wangle/service:ServiceTest - Wangle.ClientServerTest
  TIMEOUT: 0
  OMIT: 0
```

Differential Revision: D3714069

fbshipit-source-id: 178f11795a12742c5b2eee5179375c250758daba
This was referenced Jun 21, 2017
facebook-github-bot pushed a commit that referenced this pull request Dec 19, 2017
Summary:
This diff fixes the following memory leak:

```
xbu@devvm149:[~/fbsource/fbcode]: ASAN_OPTIONS=detect_leaks=1 buck test mode/dbg-asan wangle/acceptor/... -- --gtest-verbose-level 4 --no-print-passing --extended-tests
Building: finished in 0.6 sec (100%) 313/313 jobs, 0 updated, 0.0% cache miss
  Total time: 1.3 sec
TestPilot test runner for Facebook. See https://fburl.com/testpilot for details.
Testpilot build a22a8825fb55ce2ee4f36dd7a7705c900fc0d0b8 at Fri Dec 15 09:19:24 2017 by lpetre from /usr/local/fbprojects/packages/testinfra.testpilot/370/t.par
Trace available for this run at /tmp/testpilot.20171218-123822.3529484.log
Discovering tests
Running 45 tests
Started new test run: https://our.intern.facebook.com/intern/testinfra/testrun/805811534
      ☢ wangle/acceptor/test:EvbHandshakeHelperTest - EvbHandshakeHelperTest.TestDropConnection 0.008s 45/45 (FATAL)
Test appears to have passed but the binary exited with non-zero exit code 1.
This usually means something has crashed after the test was done.
Unfiltered output from the test binary:

Note: Google Test filter = EvbHandshakeHelperTest.TestDropConnection
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from EvbHandshakeHelperTest
[ RUN      ] EvbHandshakeHelperTest.TestDropConnection
[       OK ] EvbHandshakeHelperTest.TestDropConnection (8 ms)
[----------] 1 test from EvbHandshakeHelperTest (8 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (8 ms total)
[  PASSED  ] 1 test.

=================================================================
==3529740==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2848 byte(s) in 1 object(s) allocated from:
    #0 0xe08a18 in operator new(unsigned long) (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xe08a18)
    #1 0x4706f8 in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #2 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #3 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #4 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #5 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #6 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #7 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #8 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #9 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #10 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #11 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #12 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #13 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #14 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #15 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #16 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #17 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530
    #18 0x4ef004 in std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::operator()() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1520
    #19 0x4ee828 in std::thread::_Impl<std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)> >::_M_run() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/thread:115
    #20 0x7f4ab08d9170 in execute_native_thread_routine /home/engshare/third-party2/libgcc/5.x/src/gcc-5/x86_64-facebook-linux/libstdc++-v3/src/c++11/../../../.././libstdc++-v3/src/c++11/thread.cc:84
    #21 0x7f4aafdba7a8 in start_thread /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/nptl/pthread_create.c:333

Indirect leak of 1024 byte(s) in 1 object(s) allocated from:
    #0 0xecfc60 in realloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecfc60)
    #1 0x7f4ab0e293fb in CRYPTO_realloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:379
    #2 0x7f4ab0efc144 in sk_dup /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/stack/stack.c:99
    #3 0x7f4ab12a93d3 in ssl_create_cipher_list /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_ciph.c:1678
    #4 0x7f4ab12a0753 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2053
    #5 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #6 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #7 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #8 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #9 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #10 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #11 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #12 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #13 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #14 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #15 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #16 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #17 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #18 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #19 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #20 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #21 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #22 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #23 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #24 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #25 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #26 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #27 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #28 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #29 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40

Indirect leak of 1024 byte(s) in 1 object(s) allocated from:
    #0 0xecfc60 in realloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecfc60)
    #1 0x7f4ab0e293fb in CRYPTO_realloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:379
    #2 0x7f4ab0efbf37 in sk_insert /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/stack/stack.c:186
    #3 0x7f4ab12a93ba in ssl_create_cipher_list /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_ciph.c:1670
    #4 0x7f4ab12a0753 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2053
    #5 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #6 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #7 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #8 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #9 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #10 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #11 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #12 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #13 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #14 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #15 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #16 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #17 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #18 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #19 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #20 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #21 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #22 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #23 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #24 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #25 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #26 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #27 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #28 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #29 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40

Indirect leak of 832 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab12a05b5 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:1988
    #3 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #4 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #5 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #6 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #7 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #8 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #9 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #10 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #11 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #12 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #13 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #14 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #15 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #16 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #17 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #18 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #19 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #20 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #21 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #22 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #23 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #24 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #25 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #26 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #27 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #28 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530
    #29 0x4ef004 in std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::operator()() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1520

Indirect leak of 752 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab12a377e in ssl_cert_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_cert.c:204
    #3 0x7f4ab12a06ac in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2037
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 280 byte(s) in 1 object(s) allocated from:
    #0 0xe08a18 in operator new(unsigned long) (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xe08a18)
    #1 0x472618 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:104
    #2 0x47252b in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:478
    #3 0x4720b4 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2> >&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/allocated_ptr.h:102
    #4 0x471d5c in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:615
    #5 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #6 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #7 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #8 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #9 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #10 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #11 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #12 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #13 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #14 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #15 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #16 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #17 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #18 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #19 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #20 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #21 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #22 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #23 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #24 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #25 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530
    #26 0x4ef004 in std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::operator()() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1520
    #27 0x4ee828 in std::thread::_Impl<std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)> >::_M_run() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/thread:115
    #28 0x7f4ab08d9170 in execute_native_thread_routine /home/engshare/third-party2/libgcc/5.x/src/gcc-5/x86_64-facebook-linux/libstdc++-v3/src/c++11/../../../.././libstdc++-v3/src/c++11/thread.cc:84
    #29 0x7f4aafdba7a8 in start_thread /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/nptl/pthread_create.c:333

Indirect leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0efc668 in lh_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/lhash/lhash.c:138
    #3 0x7f4ab12a0706 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2046
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 144 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0f59a3e in X509_STORE_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_lu.c:186
    #3 0x7f4ab12a0718 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2049
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0efc68a in lh_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/lhash/lhash.c:140
    #3 0x7f4ab12a0706 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2046
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0f5d2e2 in X509_VERIFY_PARAM_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_vpm.c:176
    #3 0x7f4ab12a0772 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2063
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0f5d2e2 in X509_VERIFY_PARAM_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_vpm.c:176
    #3 0x7f4ab0f59a90 in X509_STORE_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_lu.c:196
    #4 0x7f4ab12a0718 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2049
    #5 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #6 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #7 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #8 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #9 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #10 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #11 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #12 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #13 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #14 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #15 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #16 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #17 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #18 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #19 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #20 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #21 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #22 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #23 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #24 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #25 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #26 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #27 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #28 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #29 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0f5d315 in X509_VERIFY_PARAM_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_vpm.c:181
    #3 0x7f4ab12a0772 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2063
    #4 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #5 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #6 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/alloc_traits.h:517
    #7 0x4722cc in std::_Sp_counted_ptr_inplace<folly::SSLContext, std::allocator<folly::SSLContext>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<folly::SSLContext>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:522
    #8 0x471db1 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<folly::SSLContext, std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, folly::SSLContext*, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:617
    #9 0x471b13 in std::__shared_ptr<folly::SSLContext, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr_base.h:1096
    #10 0x471ab7 in std::shared_ptr<folly::SSLContext>::shared_ptr<std::allocator<folly::SSLContext>>(std::_Sp_make_shared_tag, std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:319
    #11 0x471a3b in std::shared_ptr<folly::SSLContext> std::allocate_shared<folly::SSLContext, std::allocator<folly::SSLContext>>(std::allocator<folly::SSLContext> const&) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:619
    #12 0x470d6a in std::shared_ptr<folly::SSLContext> std::make_shared<folly::SSLContext>() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/bits/shared_ptr.h:635
    #13 0x47071d in EvbHandshakeHelperTest::SetUp()::{lambda()#1}::operator()() const wangle/acceptor/test/EvbHandshakeHelperTest.cpp:43
    #14 0x470454 in void folly::detail::function::FunctionTraits<void ()>::callSmall<EvbHandshakeHelperTest::SetUp()::{lambda()#1}>(folly::detail::function::Data&) folly/Function.h:314
    #15 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #16 0x785481 in folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3::operator()() folly/io/async/EventBase.cpp:581
    #17 0x78517f in void folly::detail::function::FunctionTraits<void ()>::callBig<folly::EventBase::runInEventBaseThreadAndWait(folly::Function<void ()>)::$_3>(folly::detail::function::Data&) folly/Function.h:321
    #18 0x4e91f9 in folly::detail::function::FunctionTraits<void ()>::operator()() folly/Function.h:330
    #19 0x7a56bd in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) folly/io/async/EventBase.cpp:59
    #20 0x79628c in folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) folly/io/async/NotificationQueue.h:703
    #21 0x7a5701 in folly::NotificationQueue<folly::Function<void ()> >::Consumer::handlerReady(unsigned short) folly/io/async/NotificationQueue.h:640
    #22 0x7b0864 in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
    #23 0xfb0cb8 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
    #24 0xfb0f7f in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
    #25 0x77c545 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:314
    #26 0x77b366 in folly::EventBase::loop() folly/io/async/EventBase.cpp:253
    #27 0x77fffd in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:451
    #28 0x4e6ad4 in folly::run(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&) folly/io/async/ScopedEventBaseThread.cpp:40
    #29 0x4ef13c in void std::_Bind_simple<void (*(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*>))(folly::EventBaseManager*, folly::EventBase*, folly::Baton<std::atomic, true>*, folly::Range<char const*> const&)>::_M_invoke<0ul, 1ul, 2ul, 3ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530

Indirect leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0xecf7f8 in malloc (/data/users/xbu/fbsource/fbcode/buck-out/dbg-asan/gen/wangle/acceptor/test/EvbHandshakeHelperTest+0xecf7f8)
    #1 0x7f4ab0e292e8 in CRYPTO_malloc /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/mem.c:346
    #2 0x7f4ab0f5d315 in X509_VERIFY_PARAM_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_vpm.c:181
    #3 0x7f4ab0f59a90 in X509_STORE_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/crypto/x509/x509_lu.c:196
    #4 0x7f4ab12a0718 in SSL_CTX_new /home/engshare/third-party2/openssl/1.0.2/src/openssl-1.0.2/ssl/ssl_lib.c:2049
    #5 0x6ebf18 in folly::SSLContext::SSLContext(folly::SSLContext::SSLVersion) folly/io/async/SSLContext.cpp:39
    #6 0x472c22 in void __gnu_cxx::new_allocator<folly::SSLContext>::construct<folly::SSLContext>(folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/ext/new_allocator.h:120
    #7 0x4727d7 in void std::allocator_traits<std::allocator<folly::SSLContext> >::construct<folly::SSLContext>(std::allocator<folly::SSLContext>&, folly::SSLContext*) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c+(Truncated to 64511B by TestPilot; full output here: everstore://GPc2hQG7w0VgXwsHAAAAAADBLqhJbswMAAAz:Full_Test_Output:)
Finished test run: https://our.intern.facebook.com/intern/testinfra/testr…
meta-codesync Bot pushed a commit that referenced this pull request Apr 30, 2026
Summary:
ServerBootstrap's sockets_ vector has no synchronization despite being shared (via shared_ptr) between ServerBootstrap and ServerWorkerPool and accessed from multiple threads. When a ServerBootstrap is stopped while the IO thread pool is shutting down, one thread clears sockets_ (stop()) while another thread iterates it (unregisterEventBase()), causing a heap-use-after-free crash.

The sibling data structure workers_ is properly protected by workersMutex_, but sockets_ had zero synchronization.

Fix: Wrap the sockets_ vector in `folly::Synchronized`, changing the shared type from `shared_ptr<vector<...>>` to `shared_ptr<Synchronized<vector<...>>>`. All access sites now go through the Synchronized API:
- registerEventBase: `rlock()` while iterating sockets_
- unregisterEventBase: `rlock()` while iterating sockets_
- clearSockets (new): `wlock()` while clearing sockets_
- ServerBootstrap::bind/bindImpl: `wlock()` while pushing new sockets
- ServerBootstrap::stop(): calls workerFactory_->clearSockets() instead of directly clearing sockets_
- ServerBootstrap::getSockets(): returns a copy via `rlock()` (previously returned a const reference)

## Reproduction (without fix)

Reverting the synchronization and running the new test under ASAN produces a heap-use-after-free on the first iteration:

```
==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c795e1fd390
READ of size 8 at 0x7c795e1fd390 thread T21
SCARINESS: 51 (8-byte-read-heap-use-after-free)
  #0 wangle::ServerWorkerPool::unregisterEventBase(folly::EventBase&)
     fbcode/wangle/bootstrap/ServerBootstrap.cpp:66
  #1 folly::IOThreadPoolExecutor::handleObserverUnregisterThread(...)
  #2 folly::IOThreadPoolExecutor::stopThreads(unsigned long)
  #3 folly::ThreadPoolExecutor::removeThreads(unsigned long, bool)
  #4 folly::ThreadPoolExecutor::setNumThreads(unsigned long)

freed by thread T19 here:
  #0 operator delete(void*, unsigned long)
  #1 folly::AsyncServerSocket::~AsyncServerSocket()
  ...
  #5 wangle::AsyncServerSocketFactory::ThreadSafeDestructor::operator()
```

Thread T19 (stop) clears sockets_ which destroys the AsyncServerSocket objects, while thread T21 (pool thread removal via setNumThreads(0)) iterates sockets_ in unregisterEventBase and reads freed memory.

With the fix applied, `folly::Synchronized` ensures clearSockets() acquires an exclusive write lock while clearing, and unregisterEventBase/registerEventBase acquire shared read locks while iterating, preventing the race.

Reviewed By: hanidamlaj

Differential Revision: D101734719

fbshipit-source-id: 1a796fcb29123a7de3f5674801da8eea6709ea03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants