llvm / llvm-project

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

[`lldb-dap`] Exception Code: 0x80000003 on windows (build by vs2022) #97671

Open valord577 opened 1 month ago

valord577 commented 1 month ago
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Exception Code: 0x80000003
 #0 0x00007ff64d68801c HandleAbort C:\Users\valor\Desktop\Code\nativepkgs\deps\llvm\llvm\lib\Support\Windows\Signals.inc:424:0
 #1 0x00007ff64d818d7d raise minkernel\crts\ucrt\src\appcrt\misc\signal.cpp:547:0
 #2 0x00007ff64d809878 abort minkernel\crts\ucrt\src\appcrt\startup\abort.cpp:71:0
 #3 0x00007ff64d5e8cab std::terminate(void) C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include\exception:182:0
 #4 0x00007ff64d5d9090 std::thread::~thread(void) C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include\thread:98:0
 #5 0x00007ff64d629b6b lldb_dap::DAP::~DAP(void) C:\Users\valor\Desktop\Code\nativepkgs\deps\llvm\lldb\tools\lldb-dap\DAP.cpp:66:0
 #6 0x00007ff64d8455f2 lldb_dap::`dynamic atexit destructor for 'g_dap'' (C:\Users\valor\Desktop\Code\nativepkgs\out\llvm\win-msvc\amd64\bin\lldb-dap.exe+0x2955f2)
 #7 0x00007ff64d820a93 __crt_fast_decode_pointer vccrt\vcruntime\inc\internal_shared.h:506:0
 #8 0x00007ff64d820a93 <lambda_f03950bc5685219e0bcd2087efbe011e>::operator() minkernel\crts\ucrt\src\appcrt\startup\onexit.cpp:206:0
 #9 0x00007ff64d8206e9 __crt_seh_guarded_call<int>::operator()<<lambda_7777bce6b2f8c936911f934f8298dc43>,<lambda_f03950bc5685219e0bcd2087efbe011e> &,<lambda_3883c3dff614d5e0c5f61bb1ac94921c> > vccrt\vcruntime\inc\internal_shared.h:204:0
#10 0x00007ff64d820b99 _execute_onexit_table minkernel\crts\ucrt\src\appcrt\startup\onexit.cpp:231:0
#11 0x00007ff64d809503 <lambda_6e4b09c48022b2350581041d5f6b0c4c>::operator() minkernel\crts\ucrt\src\appcrt\startup\exit.cpp:232:0
#12 0x00007ff64d8093c5 __crt_seh_guarded_call<void>::operator()<<lambda_d80eeec6fff315bfe5c115232f3240e3>,<lambda_6e4b09c48022b2350581041d5f6b0c4c> &,<lambda_2358e3775559c9db80273638284d5e45> > vccrt\vcruntime\inc\internal_shared.h:224:0
#13 0x00007ff64d809657 common_exit minkernel\crts\ucrt\src\appcrt\startup\exit.cpp:278:0
#14 0x00007ff64d7deffb __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:295:0
#15 0x00007ffae6a7257d (C:\WINDOWS\System32\KERNEL32.DLL+0x1257d)
#16 0x00007ffae836af28 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x5af28)
PS ...path...> git clone --depth=1 https://github.com/valord577/nativepkgs.git
PS ...path...> cd .\nativepkgs
PS ...path...> ${env:LIB_RELEASE} = "0"  # build debug output

# auto enter vs env (2019/2022) and print cmake command line
PS ...path...> .\build_win-msvc_amd64.ps1 llvm

...

# output to nativepkgs\out\
Screenshot 2024-07-04 at 11 16 57
valord577 commented 1 month ago
Screenshot 2024-07-04 at 13 27 25
compnerd commented 1 month ago

Frame #3 is interesting as that is the source of the call to std::terminate which is then leading to the application termination.

https://github.com/microsoft/STL/blob/main/stl/inc/thread#L96-L100 Seems to match with L98 being: _STD terminate(); // per N4950 [thread.thread.destr]/1.

This implies that the thread is joinable (aka, not detached). It is interesting in that this requirement has always been there, so it seems that something has changed where the thread is not being detached or joined as it should.

valord577 commented 3 days ago

Is there any update please? @EugeneZelenko