Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14603] Linux: lldb (5.4) gets stuck forever, consuming 100% CPU #4312

Open
weissi opened this issue May 6, 2021 · 2 comments
Open

[SR-14603] Linux: lldb (5.4) gets stuck forever, consuming 100% CPU #4312

weissi opened this issue May 6, 2021 · 2 comments
Labels
bug LLDB for Swift

Comments

@weissi
Copy link
Member

@weissi weissi commented May 6, 2021

Previous ID SR-14603
Radar rdar://problem/77673440
Original Reporter @weissi
Type Bug
Environment

5.4 release (no asserts)

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: d1085616e834af0aaef8383feaae7326

Issue Description:

git clone https://github.com/apple/swift-nio
cd swift-nio && git reset c51907f551c6b2e4366b5ccbe8c0509b0b061026
swift build --build-tests

lldb --batch -o 'break set -f RecvByteBufAllocatorTest.swift -l 21' -o run -o 'frame variable --show-all-children' .build/debug/swift-nioPackageTests.xctest

This just gets stuck consuming 100% CPU (between lldb and lldb-server). I left it running for almost an hour and nothing more happened.

When I interrupt LLDB (using Ctrl+), then I get the following stack trace:

0.  Program arguments: lldb --batch -o break set -f RecvByteBufAllocatorTest.swift -l 21 -o run -o frame variable --show-all-children .build/debug/swift-nioPackageTests.xctest 
 #​0 0x0000000000421024 PrintStackTraceSignalHandler(void*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x421024)
 #​1 0x000000000041f0ce llvm::sys::RunSignalHandlers() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x41f0ce)
 #​2 0x00000000004214b5 SignalHandler(int) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x4214b5)
 #​3 0x00007fdf4a3f73c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #​4 0x00007fdf4090a12b select (/lib/x86_64-linux-gnu/libc.so.6+0x11812b)
 #​5 0x00007fdf41e6df71 SelectHelper::Select() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x10fbf71)
 #&#8203;6 0x00007fdf41cabc7c lldb_private::ConnectionFileDescriptor::BytesAvailable(lldb_private::Timeout<std::ratio<1l, 1000000l> > const&, lldb_private::Status*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf39c7c)
 #&#8203;7 0x00007fdf41cab6e8 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, lldb_private::Timeout<std::ratio<1l, 1000000l> > const&, lldb::ConnectionStatus&, lldb_private::Status*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf396e8)
 #&#8203;8 0x00007fdf41bf20a4 lldb_private::Communication::Read(void*, unsigned long, lldb_private::Timeout<std::ratio<1l, 1000000l> > const&, lldb::ConnectionStatus&, lldb_private::Status*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xe800a4)
 #&#8203;9 0x00007fdf420600fd lldb_private::process_gdb_remote::GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote&, lldb_private::Timeout<std::ratio<1l, 1000000l> >, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x12ee0fd)
#&#8203;10 0x00007fdf4205e987 lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(llvm::StringRef, StringExtractorGDBRemote&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x12ec987)
#&#8203;11 0x00007fdf4205e852 lldb_private::process_gdb_remote::GDBRemoteClientBase::SendPacketAndWaitForResponse(llvm::StringRef, StringExtractorGDBRemote&, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x12ec852)
#&#8203;12 0x00007fdf420898ef lldb_private::process_gdb_remote::ProcessGDBRemote::DoReadMemory(unsigned long, void*, unsigned long, lldb_private::Status&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x13178ef)
#&#8203;13 0x00007fdf41d6250d lldb_private::Process::ReadMemoryFromInferior(unsigned long, void*, unsigned long, lldb_private::Status&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xff050d)
#&#8203;14 0x00007fdf41e2f3b7 lldb_private::MemoryCache::Read(unsigned long, void*, unsigned long, lldb_private::Status&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x10bd3b7)
#&#8203;15 0x00007fdf41c63de3 lldb_private::Value::GetValueAsData(lldb_private::ExecutionContext*, lldb_private::DataExtractor&, lldb_private::Module*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xef1de3)
#&#8203;16 0x00007fdf41c5da81 lldb_private::ValueObjectSynthetic::CopyValueData(lldb_private::ValueObject*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xeeba81)
#&#8203;17 0x00007fdf41c5d9e5 lldb_private::ValueObjectSynthetic::ValueObjectSynthetic(lldb_private::ValueObject&, std::shared_ptr<lldb_private::SyntheticChildren>) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xeeb9e5)
#&#8203;18 0x00007fdf41c4ed3c lldb_private::ValueObject::CalculateSyntheticValue() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xedcd3c)
#&#8203;19 0x00007fdf41c49fb6 lldb_private::ValueObject::GetSyntheticValue() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xed7fb6)
#&#8203;20 0x00007fdf41c823ba lldb_private::ValueObjectPrinter::GetMostSpecializedValue() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf103ba)
#&#8203;21 0x00007fdf41c8219c lldb_private::ValueObjectPrinter::PrintValueObject() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf1019c)
#&#8203;22 0x00007fdf41c83d55 lldb_private::ValueObjectPrinter::PrintChild(std::shared_ptr<lldb_private::ValueObject>, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf11d55)
#&#8203;23 0x00007fdf41c84230 lldb_private::ValueObjectPrinter::PrintChildren(bool, bool, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf12230)
#&#8203;24 0x00007fdf41c82ece lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10ece)
#&#8203;25 0x00007fdf41c82261 lldb_private::ValueObjectPrinter::PrintValueObject() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10261)
#&#8203;26 0x00007fdf41c83d55 lldb_private::ValueObjectPrinter::PrintChild(std::shared_ptr<lldb_private::ValueObject>, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf11d55)
#&#8203;27 0x00007fdf41c84230 lldb_private::ValueObjectPrinter::PrintChildren(bool, bool, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf12230)
#&#8203;28 0x00007fdf41c82ece lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10ece)
#&#8203;29 0x00007fdf41c82261 lldb_private::ValueObjectPrinter::PrintValueObject() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10261)
#&#8203;30 0x00007fdf41c83d55 lldb_private::ValueObjectPrinter::PrintChild(std::shared_ptr<lldb_private::ValueObject>, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf11d55)
#&#8203;31 0x00007fdf41c84230 lldb_private::ValueObjectPrinter::PrintChildren(bool, bool, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf12230)
#&#8203;32 0x00007fdf41c82ece lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10ece)
#&#8203;33 0x00007fdf41c82261 lldb_private::ValueObjectPrinter::PrintValueObject() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10261)
#&#8203;34 0x00007fdf41c83d55 lldb_private::ValueObjectPrinter::PrintChild(std::shared_ptr<lldb_private::ValueObject>, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf11d55)
#&#8203;35 0x00007fdf41c84230 lldb_private::ValueObjectPrinter::PrintChildren(bool, bool, lldb_private::DumpValueObjectOptions::PointerDepth const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf12230)
#&#8203;36 0x00007fdf41c82ece lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10ece)
#&#8203;37 0x00007fdf41c82261 lldb_private::ValueObjectPrinter::PrintValueObject() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf10261)
#&#8203;38 0x00007fdf41c51b03 lldb_private::ValueObject::Dump(lldb_private::Stream&, lldb_private::DumpValueObjectOptions const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xedfb03)
#&#8203;39 0x00007fdf422de15f CommandObjectFrameVariable::DoExecute(lldb_private::Args&, lldb_private::CommandReturnObject&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x156c15f)
#&#8203;40 0x00007fdf41cd3477 lldb_private::CommandObjectParsed::Execute(char const*, lldb_private::CommandReturnObject&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf61477)
#&#8203;41 0x00007fdf41cc94ac lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf574ac)
#&#8203;42 0x00007fdf41cccdec lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf5adec)
#&#8203;43 0x00007fdf41c14456 lldb_private::IOHandlerEditline::Run() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xea2456)
#&#8203;44 0x00007fdf41bf8834 lldb_private::Debugger::RunIOHandlers() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xe86834)
#&#8203;45 0x00007fdf41cce52d lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xf5c52d)
#&#8203;46 0x00007fdf418bc85d lldb::SBDebugger::RunCommandInterpreter(lldb::SBCommandInterpreterRunOptions const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xb4a85d)
#&#8203;47 0x000000000040a70a Driver::MainLoop() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40a70a)
#&#8203;48 0x000000000040c7af main (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40c7af)
#&#8203;49 0x00007fdf408190b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#&#8203;50 0x000000000040716e _start (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40716e)
^\PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.  Program arguments: lldb --reproducer-finalize /tmp/reproducer-3de6ad 
 #&#8203;0 0x0000000000421024 PrintStackTraceSignalHandler(void*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x421024)
 #&#8203;1 0x000000000041f0ce llvm::sys::RunSignalHandlers() (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x41f0ce)
 #&#8203;2 0x00000000004214b5 SignalHandler(int) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x4214b5)
 #&#8203;3 0x00007f8971d273c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #&#8203;4 0x00007f8971d26332 read (/lib/x86_64-linux-gnu/libpthread.so.0+0x14332)
 #&#8203;5 0x00007f8969b9c429 llvm::sys::fs::copy_file_internal(int, int) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x14fa429)
 #&#8203;6 0x00007f8969b9c17a llvm::sys::fs::copy_file(llvm::Twine const&, llvm::Twine const&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x14fa17a)
 #&#8203;7 0x00007f8969b4b9bf llvm::FileCollector::copyFiles(bool) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x14a99bf)
 #&#8203;8 0x00007f896979291a lldb_private::repro::Finalize(lldb_private::repro::Loader*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0x10f091a)
 #&#8203;9 0x00007f89692f329a lldb::SBReproducer::Finalize(char const*) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/../lib/liblldb.so.10+0xc5129a)
#&#8203;10 0x000000000040af30 InitializeReproducer(llvm::StringRef, llvm::opt::InputArgList&) (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40af30)
#&#8203;11 0x000000000040c26e main (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40c26e)
#&#8203;12 0x00007f89681490b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#&#8203;13 0x000000000040716e _start (/tmp/swift-5.4-RELEASE-ubuntu20.04/usr/bin/lldb+0x40716e)
@weissi
Copy link
Member Author

@weissi weissi commented May 6, 2021

@swift-ci create

1 similar comment
@weissi
Copy link
Member Author

@weissi weissi commented May 7, 2021

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug LLDB for Swift
Projects
None yet
Development

No branches or pull requests

1 participant