llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.76k stars 10.96k forks source link

Exception 0xC0000005 while loading debugee in eclipse. #96929

Open nikitin- opened 1 week ago

nikitin- commented 1 week ago

Hello!

I'm trying to setup a "debug session" for .exe file in eclipse (Eclipse Version: 2024-06 (4.32.0)). I'm using "custom toolchain" for building .exe in eclipse/cdt. This "custom toolchain" involves Microsoft Visual Studio's (2019 / c++17) "cl.exe / link.exe"

I have installed the "lldb debugger" via https://github.com/mstorsjo/llvm-mingw/releases this is the version to be installed: https://github.com/mstorsjo/llvm-mingw/releases/tag/20240619 in particular: https://github.com/mstorsjo/llvm-mingw/releases/download/20240619/llvm-mingw-20240619-msvcrt-x86_64.zip

So ... When launching the debug session in eclipse for my application (that uses third-party dll's) - I got the following stacktrace:

Exception Code: 0xC0000005
 #0 0x00007ffe5841a48a llvm::pdb::GlobalsStream::findRecordsByName(llvm::StringRef, llvm::pdb::SymbolStream const&) const (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\libLLVM-18.dll+0x1efa48a)
 #1 0x00007ffe5b700e38 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x820e38)
 #2 0x00007ffe5b14360b PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x26360b)
 #3 0x00007ffe5b5903bc PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x6b03bc)
 #4 0x00007ffe5b46a1ea PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x58a1ea)
 #5 0x00007ffe5b46a527 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x58a527)
 #6 0x00007ffe5b1067f9 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x2267f9)
 #7 0x00007ffe5b106e11 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x226e11)
 #8 0x00007ffe5b10f541 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x22f541)
 #9 0x00007ffe5b231236 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x351236)
#10 0x00007ffe5b232023 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x352023)
#11 0x00007ffe5b148c06 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x268c06)
#12 0x00007ffe5b230e15 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x350e15)
#13 0x00007ffe5b2af769 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x3cf769)
#14 0x00007ffe5b3a7ef4 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x4c7ef4)
#15 0x00007ffe5b684696 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a4696)
#16 0x00007ffe5b688a39 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a8a39)
#17 0x00007ffe5b688382 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a8382)
#18 0x00007ffe5b686423 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a6423)
#19 0x00007ffe5b68605f PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a605f)
#20 0x00007ffe5b688eb4 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x7a8eb4)
#21 0x00007ffe5b73e562 PyInit__lldb (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64in\liblldb.dll+0x85e562)
#22 0x00007ffeb7a1b0ea (C:\Windows\System32\msvcrt.dll+0x3b0ea)
#23 0x00007ffeb7a1b1bc (C:\Windows\System32\msvcrt.dll+0x3b1bc)
#24 0x00007ffeb61b7ac4 (C:\Windows\System32\KERNEL32.DLL+0x17ac4)
#25 0x00007ffeb7e3a4e1 (C:\Windows\SYSTEM32
tdll.dll+0x5a4e1)
nikitin- commented 1 week ago

Some additional comments from me:

It looks like that if "lldb debugger" can not find ".pdb" file from .exe OR one of the "custom *.dll" dependent files - it throws the "Exception Code: 0xC0000005" somewhere in :

#0 0x00007ffe5841a48a llvm::pdb::GlobalsStream::findRecordsByName(llvm::StringRef, llvm::pdb::SymbolStream const&) const (D:\llvm\llvm-mingw-20240619-msvcrt-x86_64�in\libLLVM-18.dll+0x1efa48a)