Open ghamarian opened 3 weeks ago
@llvm/issue-subscribers-lldb
Author: Amir Ghamarian (ghamarian)
Could you please try 19 or main
branch?
I have tried 18 as well. I give 19 a try.
I compiled LLDB from the main branch with debug info, and here is the stack trace I get.
LLDB diagnostics will be written to /tmp/diagnostics-c66e4a
Please include the directory content when filing a bug report
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
#0 0x000055dbfb8a7ef8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/aghamari/projects/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13
#1 0x000055dbfb8a6500 llvm::sys::RunSignalHandlers() /home/aghamari/projects/llvm-project/llvm/lib/Support/Signals.cpp:106:18
#2 0x000055dbfb8a8888 SignalHandler(int) /home/aghamari/projects/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
#3 0x00007f993ba22520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f993cdb3e43 GetPltEntrySizeAndOffset(elf::ELFSectionHeader const*, elf::ELFSectionHeader const*) /home/aghamari/projects/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2516:54
#5 0x00007f993cdb3e43 ParsePLTRelocations(lldb_private::Symtab*, unsigned long, unsigned int, elf::ELFHeader const*, elf::ELFSectionHeader const*, elf::ELFSectionHeader const*, elf::ELFSectionHeader const*, std::shared_ptr<lldb_private::Section> const&, lldb_private::DataExtractor&, lldb_private::DataExtractor&, lldb_private::DataExtractor&) /home/aghamari/projects/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2559:7
#6 0x00007f993cdb3cbb ObjectFileELF::ParseTrampolineSymbols(lldb_private::Symtab*, unsigned long, ObjectFileELF::ELFSectionHeaderInfo const*, unsigned long) /home/aghamari/projects/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2677:10
#7 0x00007f993cdb57fc ObjectFileELF::ParseSymtab(lldb_private::Symtab&) /home/aghamari/projects/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:0:9
#8 0x00007f993cac0e67 std::__uniq_ptr_impl<lldb_private::Symtab, std::default_delete<lldb_private::Symtab>>::_M_ptr() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:191:51
#9 0x00007f993cac0e67 std::unique_ptr<lldb_private::Symtab, std::default_delete<lldb_private::Symtab>>::get() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:462:21
#10 0x00007f993cac0e67 std::unique_ptr<lldb_private::Symtab, std::default_delete<lldb_private::Symtab>>::operator->() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:455:9
#11 0x00007f993cac0e67 lldb_private::ObjectFile::GetSymtab()::$_0::operator()() const /home/aghamari/projects/llvm-project/lldb/source/Symbol/ObjectFile.cpp:761:9
#12 0x00007f993cac0e67 void std::__invoke_impl<void, lldb_private::ObjectFile::GetSymtab()::$_0>(std::__invoke_other, lldb_private::ObjectFile::GetSymtab()::$_0&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:61:14
#13 0x00007f993cac0e67 std::__invoke_result<lldb_private::ObjectFile::GetSymtab()::$_0>::type std::__invoke<lldb_private::ObjectFile::GetSymtab()::$_0>(lldb_private::ObjectFile::GetSymtab()::$_0&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/invoke.h:96:14
#14 0x00007f993cac0e67 void std::call_once<lldb_private::ObjectFile::GetSymtab()::$_0>(std::once_flag&, lldb_private::ObjectFile::GetSymtab()::$_0&&)::'lambda'()::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:852:4
#15 0x00007f993cac0e67 std::once_flag::_Prepare_execution::_Prepare_execution<void std::call_once<lldb_private::ObjectFile::GetSymtab()::$_0>(std::once_flag&, lldb_private::ObjectFile::GetSymtab()::$_0&&)::'lambda'()>(lldb_private::ObjectFile::GetSymtab()::$_0&)::'lambda'()::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:788:21
#16 0x00007f993cac0e67 std::once_flag::_Prepare_execution::_Prepare_execution<void std::call_once<lldb_private::ObjectFile::GetSymtab()::$_0>(std::once_flag&, lldb_private::ObjectFile::GetSymtab()::$_0&&)::'lambda'()>(lldb_private::ObjectFile::GetSymtab()::$_0&)::'lambda'()::__invoke() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:788:16
#17 0x00007f993ba79ee8 __pthread_once_slow ./nptl/pthread_once.c:118:7
#18 0x00007f993cabf0f6 void std::call_once<lldb_private::ObjectFile::GetSymtab()::$_0>(std::once_flag&, lldb_private::ObjectFile::GetSymtab()::$_0&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:859:15
#19 0x00007f993cabf0f6 void llvm::call_once<lldb_private::ObjectFile::GetSymtab()::$_0>(std::once_flag&, lldb_private::ObjectFile::GetSymtab()::$_0&&) /home/aghamari/projects/llvm-project/llvm/include/llvm/Support/Threading.h:89:5
#20 0x00007f993cabf0f6 lldb_private::ObjectFile::GetSymtab() /home/aghamari/projects/llvm-project/lldb/source/Symbol/ObjectFile.cpp:754:5
#21 0x00007f993ced005b lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::InitOSO() /home/aghamari/projects/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp:294:8
#22 0x00007f993ced0d19 std::vector<lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CompileUnitInfo, std::allocator<lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CompileUnitInfo>>::size() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:988:40
#23 0x00007f993ced0d19 lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateNumCompileUnits() /home/aghamari/projects/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp:587:31
#24 0x00007f993caf7137 lldb_private::SymbolFileCommon::GetNumCompileUnits() /home/aghamari/projects/llvm-project/lldb/source/Symbol/SymbolFile.cpp:187:29
#25 0x00007f993ced0cea lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateAbilities() /home/aghamari/projects/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp:573:23
#26 0x00007f993caf7e98 lldb_private::SymbolFileCommon::GetAbilities() /home/aghamari/projects/llvm-project/lldb/include/lldb/Symbol/SymbolFile.h:525:19
#27 0x00007f993caf6db2 lldb_private::SymbolFile::FindPlugin(std::shared_ptr<lldb_private::ObjectFile>) /home/aghamari/projects/llvm-project/lldb/source/Symbol/SymbolFile.cpp:71:32
#28 0x00007f993cacb32a std::__uniq_ptr_impl<lldb_private::SymbolFile, std::default_delete<lldb_private::SymbolFile>>::reset(lldb_private::SymbolFile*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:200:26
#29 0x00007f993cacb32a std::unique_ptr<lldb_private::SymbolFile, std::default_delete<lldb_private::SymbolFile>>::reset(lldb_private::SymbolFile*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:501:7
#30 0x00007f993cacb32a lldb_private::SymbolVendor::AddSymbolFileRepresentation(std::shared_ptr<lldb_private::ObjectFile> const&) /home/aghamari/projects/llvm-project/lldb/source/Symbol/SymbolVendor.cpp:69:21
#31 0x00007f993cacb215 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1070:6
#32 0x00007f993cacb215 std::__shared_ptr<lldb_private::ObjectFile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1524:31
#33 0x00007f993cacb215 lldb_private::SymbolVendor::FindPlugin(std::shared_ptr<lldb_private::Module> const&, lldb_private::Stream*) /home/aghamari/projects/llvm-project/lldb/source/Symbol/SymbolVendor.cpp:57:1
#34 0x00007f993c9e2618 std::__uniq_ptr_impl<lldb_private::SymbolVendor, std::default_delete<lldb_private::SymbolVendor>>::reset(lldb_private::SymbolVendor*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:200:26
#35 0x00007f993c9e2618 std::unique_ptr<lldb_private::SymbolVendor, std::default_delete<lldb_private::SymbolVendor>>::reset(lldb_private::SymbolVendor*) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:501:7
#36 0x00007f993c9e2618 lldb_private::Module::GetSymbolFile(bool, lldb_private::Stream*) /home/aghamari/projects/llvm-project/lldb/source/Core/Module.cpp:1016:22
#37 0x00007f993c9e4767 lldb_private::Module::PreloadSymbols() /home/aghamari/projects/llvm-project/lldb/source/Core/Module.cpp:1339:8
#38 0x00007f993cb71b19 llvm::SmallVectorTemplateCommon<std::shared_ptr<lldb_private::Module>, void>::getFirstEl() const /home/aghamari/projects/llvm-project/llvm/include/llvm/ADT/SmallVector.h:130:46
#39 0x00007f993cb71b19 llvm::SmallVectorTemplateCommon<std::shared_ptr<lldb_private::Module>, void>::SmallVectorTemplateCommon(unsigned long) /home/aghamari/projects/llvm-project/llvm/include/llvm/ADT/SmallVector.h:135:49
#40 0x00007f993cb71b19 llvm::SmallVectorTemplateBase<std::shared_ptr<lldb_private::Module>, false>::SmallVectorTemplateBase(unsigned long) /home/aghamari/projects/llvm-project/llvm/include/llvm/ADT/SmallVector.h:336:42
#41 0x00007f993cb71b19 llvm::SmallVectorImpl<std::shared_ptr<lldb_private::Module>>::SmallVectorImpl(unsigned int) /home/aghamari/projects/llvm-project/llvm/include/llvm/ADT/SmallVector.h:588:9
#42 0x00007f993cb71b19 llvm::SmallVector<std::shared_ptr<lldb_private::Module>, 1u>::SmallVector() /home/aghamari/projects/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1198:19
#43 0x00007f993cb71b19 lldb_private::Target::GetOrCreateModule(lldb_private::ModuleSpec const&, bool, lldb_private::Status*) /home/aghamari/projects/llvm-project/lldb/source/Target/Target.cpp:2456:40
#44 0x00007f993e743c46 std::__shared_ptr<lldb_private::Module, (__gnu_cxx::_Lock_policy)2>::operator bool() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1670:23
#45 0x00007f993e743c46 lldb_private::DynamicLoader::FindModuleViaTarget(lldb_private::FileSpec const&) /home/aghamari/projects/llvm-project/lldb/source/Core/DynamicLoader.cpp:164:16
#46 0x00007f993e743dd0 std::__shared_ptr<lldb_private::Module, (__gnu_cxx::_Lock_policy)2>::operator bool() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1670:16
#47 0x00007f993e743dd0 lldb_private::DynamicLoader::LoadModuleAtAddress(lldb_private::FileSpec const&, unsigned long, unsigned long, bool) /home/aghamari/projects/llvm-project/lldb/source/Core/DynamicLoader.cpp:174:16
#48 0x00007f993cc8af15 std::__shared_ptr<lldb_private::Module, (__gnu_cxx::_Lock_policy)2>::operator bool() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1670:23
#49 0x00007f993cc8af15 DynamicLoaderPOSIXDYLD::LoadModuleAtAddress(lldb_private::FileSpec const&, unsigned long, unsigned long, bool) /home/aghamari/projects/llvm-project/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:594:16
#50 0x00007f993cc89e01 std::__shared_ptr<lldb_private::Module, (__gnu_cxx::_Lock_policy)2>::get() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/shared_ptr_base.h:1666:16
#51 0x00007f993cc89e01 DynamicLoaderPOSIXDYLD::RefreshModules() /home/aghamari/projects/llvm-project/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:437:22
#52 0x00007f993cc899fa DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /home/aghamari/projects/llvm-project/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:386:55
#53 0x00007f993c99aff5 lldb_private::BreakpointOptions::InvokeCallback(lldb_private::StoppointCallbackContext*, unsigned long, unsigned long) /home/aghamari/projects/llvm-project/lldb/source/Breakpoint/BreakpointOptions.cpp:446:1
#54 0x00007f993c99406e lldb_private::BreakpointLocation::InvokeCallback(lldb_private::StoppointCallbackContext*) /home/aghamari/projects/llvm-project/lldb/source/Breakpoint/BreakpointLocation.cpp:0:0
#55 0x00007f993c99406e lldb_private::BreakpointLocation::ShouldStop(lldb_private::StoppointCallbackContext*) /home/aghamari/projects/llvm-project/lldb/source/Breakpoint/BreakpointLocation.cpp:400:17
#56 0x00007f993c995ae2 lldb_private::BreakpointLocationCollection::ShouldStop(lldb_private::StoppointCallbackContext*) /home/aghamari/projects/llvm-project/lldb/source/Breakpoint/BreakpointLocationCollection.cpp:129:9
#57 0x00007f993c9a9d64 lldb_private::BreakpointSite::ShouldStop(lldb_private::StoppointCallbackContext*) /home/aghamari/projects/llvm-project/lldb/source/Breakpoint/BreakpointSite.cpp:59:28
#58 0x00007f993cb5aaaa lldb_private::StopInfoBreakpoint::ShouldStopSynchronous(lldb_private::Event*) /home/aghamari/projects/llvm-project/lldb/source/Target/StopInfo.cpp:163:25
#59 0x00007f993cb8f91f lldb_private::Thread::ShouldStop(lldb_private::Event*) /home/aghamari/projects/llvm-project/lldb/source/Target/Thread.cpp:807:7
#60 0x00007f993cb9aac8 lldb_private::ThreadList::ShouldStop(lldb_private::Event*) /home/aghamari/projects/llvm-project/lldb/source/Target/ThreadList.cpp:339:9
#61 0x00007f993cb2830a lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) /home/aghamari/projects/llvm-project/lldb/source/Target/Process.cpp:3712:40
#62 0x00007f993cb227ba lldb_private::Process::HandlePrivateEvent(std::shared_ptr<lldb_private::Event>&) /home/aghamari/projects/llvm-project/lldb/source/Target/Process.cpp:3943:7
#63 0x00007f993cb293e8 lldb_private::Process::RunPrivateStateThread(bool) /home/aghamari/projects/llvm-project/lldb/source/Target/Process.cpp:4142:41
#64 0x00007f993cb34f60 std::_Function_handler<void* (), lldb_private::Process::StartPrivateStateThread(bool)::$_0>::_M_invoke(std::_Any_data const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:290:2
#65 0x00007f993ca56299 std::function<void* ()>::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/std_function.h:591:9
#66 0x00007f993ca56299 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) /home/aghamari/projects/llvm-project/lldb/source/Host/common/HostNativeThreadBase.cpp:62:10
#67 0x00007f993ba74ac3 start_thread ./nptl/pthread_create.c:442:8
#68 0x00007f993bb06850 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:83:0
@EugeneZelenko any idea if this is an lldb issue or not?
This is crashing reading the relocations for some ELF file. lldb's goal is never to crash even if the object files it is presented with are bogus in one way or another. So this is at least an lldb issue...
OTOH, debugging it with just a stack trace is likely to be difficult. If you can provide an example that causes this crash, it will be much easier to fix.
I’m working on a compiler project based on LLVM and encountering an issue when trying to debug my unit tests using LLDB-17. The debugger crashes with a floating point exception both in VSCode and from the command line. Interestingly, LLDB-17 works fine with another project.
Here are the details of the crash: