1. 21 Dec, 2019 3 commits
    • Yedidya Feldblum's avatar
      Define to_narrow in terms of implicit conversion · f3dfa82a
      Yedidya Feldblum authored
      Summary:
      [Folly] Define `to_narrow` in terms of implicit conversion to take advantage of ubsan's truncation checks.
      
      Note that integer truncation is not undefined behavior per se but is commonly unintended, so ubsan checks for it. Uses of `to_narrow` should not be subject to truncation; wherever truncation is anticipated, better to use an explicit conversion with a named destination type.
      
      Requires suppressing `-Wconversion` around the implicit conversion to avoid extraneous warnings and errors when the compiler detects narrowing implicit conversions. Since `to_narrow` models explicit conversion while merely being defined in terms of implicit conversion, it is already anticipated by all users that a narrowing conversion may occur; the warning is there to inform users only about unanticipated cases.
      
      Reviewed By: luciang
      
      Differential Revision: D19201430
      
      fbshipit-source-id: b3739d3d9aa05e95f7b3e4dff54e719691c1f04c
      f3dfa82a
    • Yedidya Feldblum's avatar
      Mark co_error as final · 186cd823
      Yedidya Feldblum authored
      Summary: [Folly] Mark `co_error` as `final`.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D19173904
      
      fbshipit-source-id: 3dedf9a27629dd495d7097d00566a92753b65778
      186cd823
    • Yedidya Feldblum's avatar
      Forbid co_error with empty exception_wrapper · e23a4b1d
      Yedidya Feldblum authored
      Summary: [Folly] Forbid `co_error` with empty `exception_wrapper`.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D19172250
      
      fbshipit-source-id: 5ffa7502eb97b6a084be3112b17f29bad2d96a0f
      e23a4b1d
  2. 20 Dec, 2019 7 commits
    • Rosen Penev's avatar
      Use ranged based for loops (#1260) · 73e26d77
      Rosen Penev authored
      Summary:
      Found with modernize-loop-convert
      Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
      Pull Request resolved: https://github.com/facebook/folly/pull/1260
      
      Reviewed By: markisaa
      
      Differential Revision: D18747876
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: f2b19654bb3fcbb75b1210edeef536c88f3052d1
      73e26d77
    • Yedidya Feldblum's avatar
      Let PriorityUnboundedQueueSet align its queues · db5458a7
      Yedidya Feldblum authored
      Summary: [Folly] Let `PriorityUnboundedQueueSet` align its queues, which have extended alignment, even when `std::allocator` does not honor extended alignment.
      
      Reviewed By: magedm
      
      Differential Revision: D19174993
      
      fbshipit-source-id: 0bc0d75c6d239c97b6e1c7380bffff0363008e16
      db5458a7
    • Yedidya Feldblum's avatar
      Let AlignedSysAllocator consider the type's alignment · 0d92b69f
      Yedidya Feldblum authored
      Summary: [Folly] Let AlignedSysAllocator consider the natural or specified alignment of the type for which memory is being allocated, rather than only considering a constant or fixed alignment.
      
      Reviewed By: nbronson
      
      Differential Revision: D19174932
      
      fbshipit-source-id: e8ed0fbaf30d285cadd061d0fe5d69fcbb16f9e2
      0d92b69f
    • Tristan Rice's avatar
      folly: propagate interrupts through thenError · 4762e080
      Tristan Rice authored
      Summary: The tagged/specific exception variant of thenError and deferError propagate interrupts where currently the untagged variant of thenError does not. As far as I can tell this was an oversight. This makes untagged thenError behave as expected.
      
      Reviewed By: yfeldblum, mpark
      
      Differential Revision: D18643814
      
      fbshipit-source-id: 42688c4363de2f6b027766b19276b2e8ec6a48a8
      4762e080
    • Yedidya Feldblum's avatar
      Remove spelled default ctor in AlignedSysAllocator · d62f47c7
      Yedidya Feldblum authored
      Summary: [Folly] Remove spelled default ctor in `AlignedSysAllocator`, which was needed only for gcc49.
      
      Reviewed By: aary
      
      Differential Revision: D19171223
      
      fbshipit-source-id: ee42f6ac188dc896519537870353116c0dfd3acd
      d62f47c7
    • Yedidya Feldblum's avatar
      Extended constructibility for co_error · da24dd6f
      Yedidya Feldblum authored
      Summary:
      [Folly] Extended constructibility for `co_error` - constructible from everything `exception_wrapper` is constructible from, but not default-constructible. This permits:
      
      ```lang=c++
      co_yield folly::coro::co_error(std::runtime_error("foo"));
      ```
      
      Reviewed By: lewissbaker
      
      Differential Revision: D19172210
      
      fbshipit-source-id: df21c4f2a15ad2286e7cb34aae7c1be05e797a94
      da24dd6f
    • Yedidya Feldblum's avatar
      Avoid a too-large pointer literal in StlVectorTest · e6eff650
      Yedidya Feldblum authored
      Summary: [Folly] Avoid a too-large pointer literal in StlVectorTest, keeping the literal value divisible by 8 to avoid ubsan violations.
      
      Reviewed By: igorsugak
      
      Differential Revision: D19170467
      
      fbshipit-source-id: 2c93d2b3d9f7515761668d3364c4b8b5093a6145
      e6eff650
  3. 19 Dec, 2019 6 commits
    • Yedidya Feldblum's avatar
      Only use explicit copy-ctor in to_narrow with C++17 · 09cbf47e
      Yedidya Feldblum authored
      Summary: [Folly] Only use `explicit` copy-ctor in `to_narrow` with C++17 and higher, since C++17 introduces mandatory copy elision and the technique here relies on mandatory copy elision.
      
      Differential Revision: D19175384
      
      fbshipit-source-id: 9d3234a71b1b5e4f31d14137e42dbf3a73c79b2e
      09cbf47e
    • Lilit Yenokyan's avatar
      Fix -Wpointer-bool-conversion violation · 764cdc0d
      Lilit Yenokyan authored
      Summary:
      Fixing warning exposed by -Wpointer-bool-conversion
      
      ```
       folly/container/test/F14MapTest.cpp:1370:35: error: address of function 'Tracked<0>::counts' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                  << "key_type ops " << Tracked<0>::counts << ", mapped_type ops "
                                     ~~ ^~~~~~~~~~~~~~~~~~
      folly/container/test/F14MapTest.cpp:1370:35: note: prefix with the address-of operator to silence this warning
                  << "key_type ops " << Tracked<0>::counts << ", mapped_type ops "
                                        ^
                                        &
      folly/container/test/F14MapTest.cpp:1371:16: error: address of function 'Tracked<1>::counts' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                  << Tracked<1>::counts;
                  ~~ ^~~~~~~~~~~~~~~~~~
      folly/container/test/F14MapTest.cpp:1371:16: note: prefix with the address-of operator to silence this warning
                  << Tracked<1>::counts;
                     ^
                     &
      2 errors generated.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19131722
      
      fbshipit-source-id: 9db48848ab5d68bc73ab0d6a4ef557d0db05414e
      764cdc0d
    • Yedidya Feldblum's avatar
      has_extended_alignemnt · 80fc6c6c
      Yedidya Feldblum authored
      Summary: [Folly] Extract `has_extended_alignemnt`.
      
      Reviewed By: aary
      
      Differential Revision: D19149753
      
      fbshipit-source-id: c6fa5cf2adcab732a21fbb31ab8ab60e978b9bc8
      80fc6c6c
    • Yedidya Feldblum's avatar
      Canonical impl of futures Core::removeStaleDependents · 36c42004
      Yedidya Feldblum authored
      Summary: [Folly] Canonical impl of futures `Core::removeStaleDependents` using std algorithms.
      
      Reviewed By: leikahing, igorsugak
      
      Differential Revision: D19167292
      
      fbshipit-source-id: 702fdf07bdcc295ed990d2c02cd3380ea81694a2
      36c42004
    • Mark Williams's avatar
      Allow folly::symbolizer::ElfFile to work with cores · 576eeaee
      Mark Williams authored
      Summary:
      In cores we're only interested in the ElfPhdrs (and there generally
      aren't any sections), so apart from some asserts, the code already
      does everything we need.
      
      Reviewed By: paulbiss
      
      Differential Revision: D19161810
      
      fbshipit-source-id: fe6e2f34413d61067156858fc652ffffd910433c
      576eeaee
    • Igor Sugak's avatar
      fix misaligned-pointer-use in StlVectorTest · be4b8793
      Igor Sugak authored
      Summary:
      Exposed by UBSAN's misaligned-pointer-use:
      ```lang=bash
      > folly/test/stl_tests/StlVectorTest.cpp:544:12: runtime error: upcast of misaligned address 0x0000feebdaed for type 'DataTracker<false>', which requires 8 byte alignment
      > 0x0000feebdaed: note: pointer points here
      > <memory cannot be printed>
      >     #0 0x6c9b93 in DataTracker<false>::~DataTracker() folly/test/stl_tests/StlVectorTest.cpp:544
      >     #1 0x6c94fe in Data<0u, 0ul>::~Data() folly/test/stl_tests/StlVectorTest.cpp:605
      >     #2 0xcc5f93 in void test_iteratorInsertionN2<folly::fbvector<Data<0u, 0ul>, std::allocator<Data<0u, 0ul> > > >(std::integral_constant<bool, true>) folly/test/stl_tests/StlVectorTest.cpp:2422
      >     #3 0x5c9bac in void test_iteratorInsertionN3<folly::fbvector<Data<0u, 0ul>, std::allocator<Data<0u, 0ul> > > >() folly/test/stl_tests/StlVectorTest.cpp:2422
      >     #4 0x5c67bd in FBVector_iteratorInsertionN_Test::TestBody() folly/test/stl_tests/StlVectorTest.cpp:2422
      >     #5 0x7f9c4e5316c9 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:2464
      >     #6 0x7f9c4e530dcc in testing::Test::Run() xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:2480
      >     #7 0x7f9c4e5350a0 in testing::TestInfo::Run() xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:2662
      >     #8 0x7f9c4e539408 in testing::TestCase::Run() xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:2780
      >     #9 0x7f9c4e55a672 in testing::internal::UnitTestImpl::RunAllTests() xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:4655
      >     #10 0x7f9c4e5595de in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:2464
      >     #11 0x7f9c4e558b72 in testing::UnitTest::Run() xplat/third-party/gmock/googletest-1.8.0/googletest/src/gtest.cc:4263
      >     #12 0x6591f3 in RUN_ALL_TESTS() buck-out/cells/fbsource/gen/xplat/third-party/gmock/gtest_headers#header-mode-symlink-tree-with-header-map,headers/gtest/gtest.h:2247
      >     #13 0x659139 in main folly/test/stl_tests/StlVectorTest.cpp:3074
      >     #14 0x7f9c4c75b1a5 in __libc_start_main /home/engshare/third-party2/glibc/2.26/src/glibc-2.26/csu/libc-start.c:308:16
      >     #15 0x4de029 in _start /home/engshare/third-party2/glibc/2.26/src/glibc-2.26/sysdeps/x86_64/start.S:120
      >
      > SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use folly/test/stl_tests/StlVectorTest.cpp:544:12
      ```
      
      Make the crafted pointer address aligned.
      
      Reviewed By: Gownta
      
      Differential Revision: D19166262
      
      fbshipit-source-id: f766656d031079350838598b135275bdbc047642
      be4b8793
  4. 18 Dec, 2019 9 commits
    • Matt Ma's avatar
      Fix broken SymbolizerTest in opt/opt-clang mode. · 1d7f3d8f
      Matt Ma authored
      Summary:
      Not sure if there is any predefined cross-platform macro that I can use the
      detect the build mode.
      
      Reviewed By: luciang
      
      Differential Revision: D19161841
      
      fbshipit-source-id: 49dd12096ab20bbcaada566f2ad854a9ea340c11
      1d7f3d8f
    • Yedidya Feldblum's avatar
      Canonical implementation of IoUringBackend::NotAvailable · ca145b44
      Yedidya Feldblum authored
      Summary: [Folly] Canonical implementation of `IoUringBackend::NotAvailable` - need to export exceptions since they are the most likely use-case for RTTI and can just bring the base class's ctors into scope.
      
      Differential Revision: D19154080
      
      fbshipit-source-id: efaf9440a5ec3d78201448160efe4b8893314956
      ca145b44
    • Andrii Grynenko's avatar
      co_await co_throw => co_yield co_error · 90052551
      Andrii Grynenko authored
      Reviewed By: yfeldblum, lewissbaker
      
      Differential Revision: D19156701
      
      fbshipit-source-id: 80bd8b7fc6dfde71756411342e5f4eb912150f06
      90052551
    • Igor Sugak's avatar
      fix unsigned-integer-overflow · c4a9979c
      Igor Sugak authored
      Summary:
      Exposed by UBSAN's unsigned-integer-overflow:
      ```
      > folly/experimental/observer/detail/Core.cpp:179:9: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')
      >     #0 0x7f605837dfea in folly::observer_detail::Core::removeStaleDependents()::$_4::operator()(std::vector<std::weak_ptr<folly::observer_detail::Core>, std::allocator<std::weak_ptr<folly::observer_detail::Core> > >&) const folly/experimental/observer/detail/Core.cpp:179
      >     #1 0x7f6058344b0c in auto folly::SynchronizedBase<folly::Synchronized<std::vector<std::weak_ptr<folly::observer_detail::Core>, std::allocator<std::weak_ptr<folly::observer_detail::Core> > >, folly::SharedMutexImpl<false, void, std::atomic, false, false> >, (folly::detail::MutexLevel)1>::withWLock<folly::observer_detail::Core::removeStaleDependents()::$_4>(folly::observer_detail::Core::removeStaleDependents()::$_4&&) folly/Synchronized.h:210
      >     #2 0x7f6058344917 in folly::observer_detail::Core::removeStaleDependents() folly/experimental/observer/detail/Core.cpp:174
      >     #3 0x7f60583785cb in folly::observer_detail::Core::~Core()::$_2::operator()(std::unordered_set<std::shared_ptr<folly::observer_detail::Core>, std::hash<std::shared_ptr<folly::observer_detail::Core> >, std::equal_to<std::shared_ptr<folly::observer_detail::Core> >, std::allocator<std::shared_ptr<folly::observer_detail::Core> > > const&) const folly/experimental/observer/detail/Core.cpp:156
      >     #4 0x7f6058343cdc in auto folly::SynchronizedBase<folly::Synchronized<std::unordered_set<std::shared_ptr<folly::observer_detail::Core>, std::hash<std::shared_ptr<folly::observer_detail::Core> >, std::equal_to<std::shared_ptr<folly::observer_detail::Core> >, std::allocator<std::shared_ptr<folly::observer_detail::Core> > >, folly::SharedMutexImpl<false, void, std::atomic, false, false> >, (folly::detail::MutexLevel)1>::withWLock<folly::observer_detail::Core::~Core()::$_2>(folly::ob
      server_detail::Core::~Core()::$_2&&) folly/Synchronized.h:210
      >     #5 0x7f6058343a17 in folly::observer_detail::Core::~Core() folly/experimental/observer/detail/Core.cpp:154
      >     #6 0x7f605838b8ca in std::_Sp_counted_ptr<folly::observer_detail::Core*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/shared_ptr_base.h:378
      >     #7 0x7f605834d411 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/shared_ptr_base.h:156
      >     #8 0x7f605834d332 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/shared_ptr_base.h:686
      >     #9 0x7f605834d23a in std::__shared_ptr<folly::observer_detail::Core, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/shared_ptr_base.h:1125
      >     #10 0x7f605833c416 in std::shared_ptr<folly::observer_detail::Core>::~shared_ptr() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/shared_ptr.h:93
      >     #11 0x7f6058376413 in folly::observer_detail::ObserverManager::scheduleRefresh(std::shared_ptr<folly::observer_detail::Core>, unsigned long)::'lambda'()::~() folly/experimental/observer/detail/ObserverManager.h:91
      >     #12 0x7f6058377014 in unsigned long folly::detail::function::execSmall<folly::observer_detail::ObserverManager::scheduleRefresh(std::shared_ptr<folly::observer_detail::Core>, unsigned long)::'lambda'()>(folly::detail::function::Op, folly::detail::function::Data*, folly::detail::function::Data*) folly/Function.h:592
      >     #13 0x7f6058377788 in folly::Function<void ()>::exec(folly::detail::function::Op, folly::detail::function::Data*, folly::detail::function::Data*) const folly/Function.h:649
      >     #14 0x7f6058376380 in folly::Function<void ()>::~Function() folly/Function.h:781
      >     #15 0x7f6058477b99 in folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()::operator()() const folly/experimental/observer/detail/ObserverManager.cpp:73
      >     #16 0x7f6058473de8 in void std::__invoke_impl<void, folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()>(std::__invoke_other, folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()&&) buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/invoke.h:60
      >     #17 0x7f6058473c08 in std::__invoke_result<folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()>::type std::__invoke<folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()>(folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()&&) buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/bits/invok
      e.h:95
      >     #18 0x7f6058473b66 in decltype(std::__invoke(_S_declval<0ul>())) std::thread::_Invoker<std::tuple<folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/thread:234
      >     #19 0x7f6058473a43 in std::thread::_Invoker<std::tuple<folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()> >::operator()() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/thread:243
      >     #20 0x7f6058473549 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<folly::observer_detail::ObserverManager::UpdatesManager::CurrentQueue::CurrentQueue()::'lambda'()> > >::_M_run() buck-out/cells/fbsource/gen/third-party/gcc/7.x/stdc++-headers#header-mode-symlink-tree-with-header-map,headers/thread:186
      >     #21 0x7f60576bac5f in std::execute_native_thread_routine(void*) third-party/gcc/7.x/libstdc++-v3/src/c++11/thread.cc:83
      >     #22 0x7f605639e6b5 in start_thread /home/engshare/third-party2/glibc/2.26/src/glibc-2.26/nptl/pthread_create.c:465:7
      >     #23 0x7f6055ecdebe in __GI___clone /home/engshare/third-party2/glibc/2.26/src/glibc-2.26/sysdeps/unix/sysv/linux/x86_64/clone.S:95
      >
      > SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow folly/experimental/observer/detail/Core.cpp:179:9
      ```
      
      Fix the error by rearranging increment and decrement operations.
      
      Reviewed By: leikahing
      
      Differential Revision: D19164999
      
      fbshipit-source-id: d3c9b638492d0bf44c2acaac1e95fafe8b785182
      c4a9979c
    • David Carlier's avatar
      FreeBSD build fix proposal. (#1281) · aae92d27
      David Carlier authored
      Summary:
      - __cxa_get_globals signature closer of the libcxxabi.
      - malloc.h exists now on FreeBSD but prevents stdlib.h inclusion if __STDC__.
      Pull Request resolved: https://github.com/facebook/folly/pull/1281
      
      Reviewed By: Orvid
      
      Differential Revision: D19140640
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 525014b5a367b8d8e95cf10e3e779cd7f0647bd5
      aae92d27
    • Andrii Grynenko's avatar
      co_throw · 8aedb408
      Andrii Grynenko authored
      Summary: An alternative to co_return Try that works for Task<void>
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19136334
      
      fbshipit-source-id: 72a18482b326dbc40b691712a5fd311efad45785
      8aedb408
    • Matt Ma's avatar
      Change symbolizer cache to support frames with inline functions. · d888f430
      Matt Ma authored
      Summary:
      The general idea is to change cache to a mapping between an address and array of frames instead of just one frame.
      
      Also changed Dwarf to directly fill frames array with inline function calls, instead of allocating extra LocationInfo array.
      
      Moved shared data structure like LocationInfo and SymbolizedFrame into a separate file so that it can used in both Dwarf.cpp and Symbolizer.cpp.
      
      Reviewed By: luciang
      
      Differential Revision: D18825831
      
      fbshipit-source-id: fe963a1adbbc6f0055c466b91708eee732abc141
      d888f430
    • Dan Melnic's avatar
      Skip the EventBase tests if the backend is not available · 616f02b2
      Dan Melnic authored
      Summary: Skip the EventBase tests if the backend is not available
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19002064
      
      fbshipit-source-id: a995df02998c80de2f9076ea16a0281b6288d6b5
      616f02b2
    • Dan Melnic's avatar
      Fix io_uring backend tests · c4ce1953
      Dan Melnic authored
      Summary: Fix io_uring backend tests
      
      Reviewed By: yfeldblum, danobi
      
      Differential Revision: D19023775
      
      fbshipit-source-id: d696064d26b37f52529c84601f6797ef82b0ddb5
      c4ce1953
  5. 17 Dec, 2019 6 commits
    • Dan Melnic's avatar
      EventBase test lib rework · 69baad3b
      Dan Melnic authored
      Summary: EventBase test lib rework
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19001877
      
      fbshipit-source-id: d99ad41007012c7bd21ee259a0a0b5ee2b709512
      69baad3b
    • Dan Melnic's avatar
      Add IoUringBackend::NotAvailable exception · 9cce3b90
      Dan Melnic authored
      Summary: Add IoUringBackend::NotAvailable exception
      
      Reviewed By: kevin-vigor
      
      Differential Revision: D19143143
      
      fbshipit-source-id: 7b55106d50882d34fc6100a81ff2a4e5748e9b85
      9cce3b90
    • Andrii Grynenko's avatar
      Split ObserverManager in leaky and non-leaky singletons · ed74c95c
      Andrii Grynenko authored
      Summary: This allows makeObserver to work even during shutdown.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19136597
      
      fbshipit-source-id: 17e946a66743a56d24904697c02ce7165bcaf397
      ed74c95c
    • Misha Shneerson's avatar
      store Linux thread identifier in TLS and use it · 22ede92e
      Misha Shneerson authored
      Summary:
      Linux thread identifier is something that we can get with `gettid`.
      http://man7.org/linux/man-pages/man2/gettid.2.html
      
      This TID is super usefully for providing thread information while debugging on Linux (this is
      the thing that `ps` command uses, or procfs), but is not really mappable from
      `std::thread::id` (e.g. the thread handle we get with `pthread_self()`).
      
      Reviewed By: yfeldblum
      
      Differential Revision: D19134596
      
      fbshipit-source-id: 32ad025c5e378e3c7b55da1aad8dd9f3e26d0892
      22ede92e
    • Elliott Clark's avatar
      Make MultiLevelTimeSeries UBSAN-clean · 33d55e3c
      Elliott Clark authored
      Summary:
      While running a system lots of different values will be added to lots of different `MultiLevelTimeSeries`. These values can be timestamps, lengths of time, file sizes, just about anything. There's no way for the underlying library to know before hand how large they will be. So it's always going to be possible to cause undefined behavior.
      
      That means we could fix this one of two ways. We could make this code be ignored for ubsan, or we could make it never roll over.
      
      I have made it so that the code won't roll over here. This seems better because it will continue to give more representative numbers. Rather than going from a very large number to a very small number, we'll remain at a very large number. That should still convey to every one that the numbers being accumulated are very large.
      
      Reviewed By: mzlee
      
      Differential Revision: D16970762
      
      fbshipit-source-id: c56f6db1dbdecefd190e6ac357133886a3642571
      33d55e3c
    • Dan Melnic's avatar
      New 20191216 liburing · 151a795b
      Dan Melnic authored
      Summary: New 20191216 liburing
      
      Reviewed By: danobi
      
      Differential Revision: D19125513
      
      fbshipit-source-id: 38d2800ee75865cb76cb06edc0328feaa44bab3e
      151a795b
  6. 16 Dec, 2019 1 commit
    • Lee Howes's avatar
      Add tracing to global executors · 791f7028
      Lee Howes authored
      Summary: Integrate calls into logging framework to allow tracking of source and use of the global executor.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D18232728
      
      fbshipit-source-id: e714b870cc041af9c99a95baf8f32c3819852b37
      791f7028
  7. 14 Dec, 2019 3 commits
    • Lee Howes's avatar
      Add logging for calls to Future::via · 1bea6f2f
      Lee Howes authored
      Summary: Adds sampled logging to track executors passed to Future::via.
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D18233242
      
      fbshipit-source-id: b5c004f643261a36fd0b63fb6e033263ece1662f
      1bea6f2f
    • Igor Sugak's avatar
      use portability/GFlags.h · f6ac9ac1
      Igor Sugak authored
      Reviewed By: Orvid
      
      Differential Revision: D19053964
      
      fbshipit-source-id: dd31937cbeb3c7ef202e4b91c1b153f849376bdf
      f6ac9ac1
    • Yedidya Feldblum's avatar
      Prefer TEST_F in folly/experimental/coro/ · c9228053
      Yedidya Feldblum authored
      Summary: [Folly] Prefer `TEST_F` and tests named `...Test` in `folly/experimental/coro/`.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D18746584
      
      fbshipit-source-id: 49156a1dca5ef115bf12add5ceb38cb7905fac3d
      c9228053
  8. 13 Dec, 2019 5 commits
    • Igor Sugak's avatar
      add missing gflags/gflags.h · f044ae2a
      Igor Sugak authored
      Summary: These files fail to build when a different version of glog is used. Notice that both cpp files use gflags but don't include its header.
      
      Reviewed By: pixelb
      
      Differential Revision: D18974446
      
      fbshipit-source-id: 4cfaa6dc62c795f4fe7f6624f078cffe550ecfec
      f044ae2a
    • Felix Handte's avatar
      Fix Zstd-less Build with Macro Guards · 3673c2eb
      Felix Handte authored
      Summary:
      D18890515 broke folly builds when zstd isn't present. (My bad!!)
      
      This should fix it.
      
      Reviewed By: lukaspiatkowski
      
      Differential Revision: D19029293
      
      fbshipit-source-id: 2ede5a8402e60af61a294c9db35ca15dffdf4c49
      3673c2eb
    • Sushil Patil's avatar
      Replacing `folly::AtomicBitset<N>` with `folly::ConcurrentBitSet<N>` · f296a1d0
      Sushil Patil authored
      Summary:
      `folly::AtomicBitSet<N>` used `N` to denote the number of blocks
      (32-bit or 64-bit each) instead of number of bits as used by
      `std::bitset`. This confusion of unit led to unintentional allocation
      of extra storage in many cases.
      
      A simple fix would be to make `N` denote number of bits. However,
      changing meaning of `N`could lead to silent breakage of code during
      run time for some users who used `N` to denote number of blocks.
      
      Therefore, to make the new meaning of `N` more explicit,
      `AtomicBitSet` is renamed to `ConcurrentBitSet` & `N` now denotes the
      number of bits.
      
      Reviewed By: al13n321
      
      Differential Revision: D18866751
      
      fbshipit-source-id: 17741646862776e1a080eaac7877f495bb56b656
      f296a1d0
    • Andrii Grynenko's avatar
      Remove unused fields from ThreadEntry · 73ccc053
      Andrii Grynenko authored
      Differential Revision: D19001755
      
      fbshipit-source-id: bda1a278017059e83c9a529aac7b429f074e42c1
      73ccc053
    • Misha Shneerson's avatar
      Store tid in ThreadEntry · cf08fcf6
      Misha Shneerson authored
      Summary: We should be able to associate rootId with the TID the request is running on.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D18918492
      
      fbshipit-source-id: 539cd78729b438928a9a4b0c93e8e17295b642d5
      cf08fcf6