Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle corner case of loading modules from NT_FILE section
Summary: In the NT_FILE section of a core file, the path to module list could be followed by "(deleted)" , also path like "/dev/zero" could be in the list. 1. Regex for removing parenthesized suffix, so trailing "(deleted)" will be removed. 2. Regex for filter out modules to load. Test Plan: Before change: ``` (lldb) target create --core "~/9s728w5ktv6jaraw" Core file '/home/hyubo/9s728w5ktv6jaraw' (x86_64) was loaded. (lldb) bt * thread #1, name = 'fbflow', stop reason = signal SIGSEGV * frame #0: 0x000000000974350e fbflow (deleted) frame #1: 0x0000000009744270 fbflow (deleted) frame #2: 0x000000000285b27e fbflow (deleted) frame llvm#3: 0x0000000008a47872 fbflow (deleted) frame llvm#4: 0x0000000008a46fe0 fbflow (deleted) frame llvm#5: 0x0000000008a45429 fbflow (deleted) frame llvm#6: 0x0000000008a46708 fbflow (deleted) frame llvm#7: 0x0000000008a45fb4 fbflow (deleted) frame llvm#8: 0x0000000008a44cf4 fbflow (deleted) frame llvm#9: 0x00000000027422c2 fbflow (deleted) frame llvm#10: 0x0000000002744b7e fbflow (deleted) frame llvm#11: 0x00007f6395a2c657 libc.so.6 (deleted) frame llvm#12: 0x00007f6395a2c718 libc.so.6 (deleted) ``` After change: ``` (lldb) target create --core "~/9s728w5ktv6jaraw" Core file '/home/hyubo/9s728w5ktv6jaraw' (x86_64) was loaded. (lldb) bt * thread #1, name = 'fbflow', stop reason = signal SIGSEGV * frame #0: 0x000000000974350e fbflow`void folly::futures::detail::coreDetachPromiseMaybeWithResult<facebook::cryptocat::store::SingleResult>(folly::futures::detail::Core<facebook::cryptocat::store::SingleResult>&) + 143 frame #1: 0x0000000009744270 fbflow`void folly::detail::function::FunctionTraits<void (folly::futures::detail::CoreBase&, folly::Executor::KeepAlive<folly::Executor>&&, folly::exception_wrapper*)>::callBig<void folly::futures::detail::Core<facebook::cryptocat::store::SingleResult>::setCallback<std::enable_if<folly::futures::detail::tryExecutorCallableResult<facebook::cryptocat::store::SingleResult, folly::Future<folly::futures::detail::tryCallableResult<facebook::cryptocat::store::SingleResult, facebook::cryptocat::store::SingleRequest, std::enable_if<is_invocable_v<facebook::cryptocat::store::SingleRequest, folly::Try<facebook::cryptocat::store::SingleResult>&&>, void>::type>::value_type> folly::Future<facebook::cryptocat::store::SingleResult>::thenTryInline<folly::SemiFuture<facebook::cryptocat::store::SingleResult> folly::SemiFuture<facebook::cryptocat::store::SingleResult>::deferError<folly::SemiFuture<facebook::cryptocat::store::SingleRequest::Result_t> facebook::cryptocat::store::DerivedCryptoStore::semifuture_loadImpl<facebook::cryptocat::store::SingleRequest>(facebook::cryptocat::store::SingleRequest const&) const::'lambda'(facebook::cryptocat::store::SingleRequest&&)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Try<facebook::cryptocat::store::SingleResult>)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&), void>::ReturnsFuture::value, folly::futures::detail::tryExecutorCallableResult<facebook::cryptocat::store::SingleResult, folly::Future<folly::futures::detail::tryCallableResult<facebook::cryptocat::store::SingleResult, facebook::cryptocat::store::SingleRequest, std::enable_if<is_invocable_v<facebook::cryptocat::store::SingleRequest, folly::Try<facebook::cryptocat::store::SingleResult>&&>, void>::type>::value_type> folly::Future<facebook::cryptocat::store::SingleResult>::thenTryInline<folly::SemiFuture<facebook::cryptocat::store::SingleResult> folly::SemiFuture<facebook::cryptocat::store::SingleResult>::deferError<folly::SemiFuture<facebook::cryptocat::store::SingleRequest::Result_t> facebook::cryptocat::store::DerivedCryptoStore::semifuture_loadImpl<facebook::cryptocat::store::SingleRequest>(facebook::cryptocat::store::SingleRequest const&) const::'lambda'(facebook::cryptocat::store::SingleRequest&&)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Try<facebook::cryptocat::store::SingleResult>)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&), void>::Return>::type folly::futures::detail::FutureBase<facebook::cryptocat::store::SingleResult>::thenImplementation<folly::Future<folly::futures::detail::tryCallableResult<facebook::cryptocat::store::SingleResult, facebook::cryptocat::store::SingleRequest, std::enable_if<is_invocable_v<facebook::cryptocat::store::SingleRequest, folly::Try<facebook::cryptocat::store::SingleResult>&&>, void>::type>::value_type> folly::Future<facebook::cryptocat::store::SingleResult>::thenTryInline<folly::SemiFuture<facebook::cryptocat::store::SingleResult> folly::SemiFuture<facebook::cryptocat::store::SingleResult>::deferError<folly::SemiFuture<facebook::cryptocat::store::SingleRequest::Result_t> facebook::cryptocat::store::DerivedCryptoStore::semifuture_loadImpl<facebook::cryptocat::store::SingleRequest>(facebook::cryptocat::store::SingleRequest const&) const::'lambda'(facebook::cryptocat::store::SingleRequest&&)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Try<facebook::cryptocat::store::SingleResult>)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&), folly::futures::detail::tryExecutorCallableResult<facebook::cryptocat::store::SingleResult, folly::Future<folly::futures::detail::tryCallableResult<facebook::cryptocat::store::SingleResult, facebook::cryptocat::store::SingleRequest, std::enable_if<is_invocable_v<facebook::cryptocat::store::SingleRequest, folly::Try<facebook::cryptocat::store::SingleResult>&&>, void>::type>::value_type> folly::Future<facebook::cryptocat::store::SingleResult>::thenTryInline<folly::SemiFuture<facebook::cryptocat::store::SingleResult> folly::SemiFuture<facebook::cryptocat::store::SingleResult>::deferError<folly::SemiFuture<facebook::cryptocat::store::SingleRequest::Result_t> facebook::cryptocat::store::DerivedCryptoStore::semifuture_loadImpl<facebook::cryptocat::store::SingleRequest>(facebook::cryptocat::store::SingleRequest const&) const::'lambda'(facebook::cryptocat::store::SingleRequest&&)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Try<facebook::cryptocat::store::SingleResult>)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&), void>>(facebook::cryptocat::store::SingleRequest&&, folly::futures::detail::tryExecutorCallableResult<facebook::cryptocat::store::SingleResult, folly::Future<folly::futures::detail::tryCallableResult<facebook::cryptocat::store::SingleResult, facebook::cryptocat::store::SingleRequest, std::enable_if<is_invocable_v<facebook::cryptocat::store::SingleRequest, folly::Try<facebook::cryptocat::store::SingleResult>&&>, void>::type>::value_type> folly::Future<facebook::cryptocat::store::SingleResult>::thenTryInline<folly::SemiFuture<facebook::cryptocat::store::SingleResult> folly::SemiFuture<facebook::cryptocat::store::SingleResult>::deferError<folly::SemiFuture<facebook::cryptocat::store::SingleRequest::Result_t> facebook::cryptocat::store::DerivedCryptoStore::semifuture_loadImpl<facebook::cryptocat::store::SingleRequest>(facebook::cryptocat::store::SingleRequest const&) const::'lambda'(facebook::cryptocat::store::SingleRequest&&)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Try<facebook::cryptocat::store::SingleResult>)>(facebook::cryptocat::store::SingleRequest&&) &&::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&), void>, folly::futures::detail::InlineContinuation)::'lambda'(folly::Executor::KeepAlive<folly::Executor>&&, folly::Try<facebook::cryptocat::store::SingleResult>&&)>(facebook::cryptocat::store::SingleRequest&&, std::shared_ptr<folly::RequestContext>&&, folly::futures::detail::InlineContinuation)::'lambda'(folly::futures::detail::CoreBase&, folly::Executor::KeepAlive<folly::Executor>&&, folly::exception_wrapper*)>(folly::futures::detail::CoreBase&, folly::Executor::KeepAlive<folly::Executor>&&, folly::exception_wrapper*, folly::detail::function::Data&) + 20 frame #2: 0x000000000285b27e fbflow`bool folly::fibers::Baton::try_wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>, bool folly::fibers::Baton::try_wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>>(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>> const&)::'lambda'()>(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>> const&, bool folly::fibers::Baton::try_wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>>(std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l>>> const&)::'lambda'()&&) + 342 frame llvm#3: 0x0000000008a47872 fbflow`facebook::logger::(anonymous namespace)::recordScubaSampleForTesting(facebook::logger::CippEventsV2UnsampledLogEntryInternal const&, long, folly::ReadMostlySharedPtr<facebook::logger::CippEventsV2UnsampledLogLineDefinition, folly::TLRefCount>, facebook::logger::WhenceScribeLogged const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (.__uniq.66043386987841263013456630564440847059) + 3452 frame llvm#4: 0x0000000008a46fe0 fbflow`facebook::logger::(anonymous namespace)::recordScubaSampleForTesting(facebook::logger::CippEventsV2UnsampledLogEntryInternal const&, long, folly::ReadMostlySharedPtr<facebook::logger::CippEventsV2UnsampledLogLineDefinition, folly::TLRefCount>, facebook::logger::WhenceScribeLogged const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (.__uniq.66043386987841263013456630564440847059) + 1258 frame llvm#5: 0x0000000008a45429 fbflow`int facebook::logger::CippEventsV2UnsampledLogger::invokeLog<std::nullptr_t, std::nullptr_t>(bool, std::nullptr_t, char const*, int, std::nullptr_t)::'lambda1'()::operator()() const + 2357 frame llvm#6: 0x0000000008a46708 fbflow`int facebook::logger::CippEventsV2UnsampledLogger::invokeLog<std::nullptr_t, std::nullptr_t>(bool, std::nullptr_t, char const*, int, std::nullptr_t)::'lambda3'()::operator()() const + 3060 frame llvm#7: 0x0000000008a45fb4 fbflow`int facebook::logger::CippEventsV2UnsampledLogger::invokeLog<std::nullptr_t, std::nullptr_t>(bool, std::nullptr_t, char const*, int, std::nullptr_t)::'lambda3'()::operator()() const + 1184 frame llvm#8: 0x0000000008a44cf4 fbflow`int facebook::logger::CippEventsV2UnsampledLogger::invokeLog<std::nullptr_t, std::nullptr_t>(bool, std::nullptr_t, char const*, int, std::nullptr_t)::'lambda1'()::operator()() const + 512 ... Reviewers: jeffreytan, gclayton Reviewed By: jeffreytan Subscribers: #lldb_team Differential Revision: https://phabricator.intern.facebook.com/D49565956 Tasks: T164491560
- Loading branch information