clangd icon indicating copy to clipboard operation
clangd copied to clipboard

Crashing when parsing a .h C++

Open AnonimiAngels opened this issue 1 year ago • 14 comments

Logs

[Info - 3:35:30 PM] Connection to server got closed. Server will restart. [Error - 3:35:33 PM] Request textDocument/hover failed. [object Object] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. #0 0x00000000004f680b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13 #1 0x00000000004f464e llvm::sys::RunSignalHandlers() /__w/clangd/clangd/llvm-project/llvm/lib/Support/Signals.cpp:106:18 #2 0x00000000004f7196 SignalHandler(int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1 #3 0x00007efc2bf1b580 (/lib/x86_64-linux-gnu/libc.so.6+0x3d580) #4 0x00000000012db453 operator< /__w/clangd/clangd/llvm-project/clang/include/clang/Basic/SourceLocation.h:199:31 #5 0x00000000012db453 operator() /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:61 #6 0x00000000012db453 partition_point<const clang::syntax::Token , (lambda at /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:7)> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_algo.h:626:8 #7 0x00000000012db453 partition_point<llvm::ArrayRefclang::syntax::Token, (lambda at /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:7), const clang::syntax::Token &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1989:10 #8 0x00000000012db453 clang::syntax::TokenBuffer::spelledTokenAt(clang::SourceLocation) const /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:388:21 #9 0x0000000001462626 clang::clangd::collectMacroReferences(clang::clangd::ParsedAST&) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/IncludeCleaner.cpp:305:12 #10 0x0000000001462ae5 _Vector_impl /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:89:34 #11 0x0000000001462ae5 _Vector_base /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:127:9 #12 0x0000000001462ae5 vector /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:263:9 #13 0x0000000001462ae5 clang::clangd::computeIncludeCleanerFindings(clang::clangd::ParsedAST&) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/IncludeCleaner.cpp:367:39 #14 0x00000000014ae1e7 getIncludeCleanerDiags /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:376:7 #15 0x00000000014ae1e7 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_deleteclang::CompilerInvocation>, llvm::ArrayRefclang::clangd::Diag, std::shared_ptr<clang::clangd::PreambleData const>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:744:14 #16 0x000000000152e9b1 ~__shared_count /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:683:6 #17 0x000000000152e9b1 ~__shared_ptr /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1123:31 #18 0x000000000152e9b1 clang::clangd::(anonymous namespace)::ASTWorker::generateDiagnostics(std::unique_ptr<clang::CompilerInvocation, std::default_deleteclang::CompilerInvocation>, clang::clangd::ParseInputs, std::vector<clang::clangd::Diag, std::allocatorclang::clangd::Diag>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1210:39 #19 0x000000000152e44b clang::clangd::(anonymous namespace)::ASTWorker::updatePreamble(std::unique_ptr<clang::CompilerInvocation, std::default_deleteclang::CompilerInvocation>, clang::clangd::ParseInputs, std::shared_ptr<clang::clangd::PreambleData const>, std::vector<clang::clangd::Diag, std::allocatorclang::clangd::Diag>, clang::clangd::WantDiagnostics)::$_2::operator()() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1144:5 #20 0x000000000152adf3 operator() /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12 #21 0x000000000152adf3 clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1324:3 #22 0x0000000001529860 run /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1459:5 #23 0x0000000001529860 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:822:42 #24 0x0000000001529860 void llvm::detail::UniqueFunctionBase::CallImpl<clang::clangd::(anonymous namespace)::ASTWorker::create(llvm::StringRef, clang::clangd::GlobalCompilationDatabase const&, clang::clangd::TUScheduler::ASTCache&, clang::clangd::TUScheduler::HeaderIncluderCache&, clang::clangd::AsyncTaskRunner, clang::clangd::Semaphore&, clang::clangd::TUScheduler::Options const&, clang::clangd::ParsingCallbacks&)::$_7>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:221:12 #25 0x00000000016a22a1 operator= /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:48:5 #26 0x00000000016a22a1 PunnedPointer /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:37:60 #27 0x00000000016a22a1 PointerIntPair /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:86:13 #28 0x00000000016a22a1 UniqueFunctionBase /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:341:3 #29 0x00000000016a22a1 unique_function /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:370:3 #30 0x00000000016a22a1 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:103:14 #31 0x00000000016a22a1 operator()<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:43:11 #32 0x00000000016a22a1 __invoke_impl<void, (lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:60:14 #33 0x00000000016a22a1 __invoke<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95:14 #34 0x00000000016a22a1 __apply_impl<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &, 0> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1662:14 #35 0x00000000016a22a1 apply<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1671:14 #36 0x00000000016a22a1 GenericThreadProxy<std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> > /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:41:5 #37 0x00000000016a22a1 void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::$_1>>(void*) /w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:55:5 #38 0x00007efc2bf67dab start_thread ./nptl/pthread_create.c:444:8 #39 0x00007efc2bfe99f8 clone3 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0 Signalled during AST worker action: Build AST Filename: /mnt/d/debian_jessie_dev_folder/games/new_york_dev/g_engine/include/g_engine/animation.h Directory: /dev_share/games/new_york_dev//g_engine Command Line: /usr/lib/llvm-16/bin/clang++ --driver-mode=g++ -D_DEBUG -g3 -ggdb -g3 -fno-omit-frame-pointer -D_A20 -fPIC -I./include -I/usr/include -I../global_utils/imgui_include -I../global_utils/imgui_include/sdl2 -I../global_utils/include -I../g_engine/include -I../g_engine/include/PCSC -I../g_engine/deps/include -I../g_engine/include/g_engine -I../g_engine/include/g_engine/kmsecure -I../board_subsystems/common/include -I../board_subsystems/a20_subsystem/deps/lib -I../c6a/include -I../cctalk/include -I../game_base/include -I../game_feature/include -I../game_utils/include -I../payengine/include -c -x c++-header -std=c++11 --std=c++0x -resource-dir=/home/astor_dev/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/18.1.3/clangd_18.1.3/lib/clang/18 -- /mnt/d/debian_jessie_dev_folder/games/new_york_dev/g_engine/include/g_engine/animation.h Version: 39 [Error - 3:35:34 PM] The Clang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

System information No LSB modules are available. Distributor ID: Kali Description: Kali GNU/Linux Rolling Release: 2024.3 Codename: kali-rolling

lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: GenuineIntel Model name: 12th Gen Intel(R) Core(TM) i5-12600K CPU family: 6 Model: 151 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 1 Stepping: 2 BogoMIPS: 7372.80 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop _tsc cpuid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase bmi1 avx2 smep b mi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves umip gfni vaes vpclmulqdq rdpid fsrm md_clear flush_l1d arch_capabilities Virtualization features: Hypervisor vendor: Microsoft Virtualization type: full Caches (sum of all):
L1d: 384 KiB (8 instances) L1i: 256 KiB (8 instances) L2: 10 MiB (8 instances) L3: 20 MiB (1 instance) Vulnerabilities:
Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Retbleed: Mitigation; Enhanced IBRS Spec rstack overflow: Not affected Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Srbds: Not affected Tsx async abort: Not affected

Output of clangd --version: clangd --version
Debian clangd version 16.0.6 (27+b1) Features: linux+grpc Platform: x86_64-pc-linux-gnu

Editor/LSP plugin: Vscode

Operating system: Wsl kali-linux

AnonimiAngels avatar Sep 16 '24 13:09 AnonimiAngels

Could you try with the latest release from https://github.com/clangd/clangd/releases/tag/18.1.3?

HighCommander4 avatar Sep 17 '24 01:09 HighCommander4

Could you try with the latest release from https://github.com/clangd/clangd/releases/tag/18.1.3?

Ill download it now

AnonimiAngels avatar Sep 17 '24 06:09 AnonimiAngels

Could you try with the latest release from https://github.com/clangd/clangd/releases/tag/18.1.3?

Same issue PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. #0 0x00000000004f680b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13 #1 0x00000000004f464e llvm::sys::RunSignalHandlers() /__w/clangd/clangd/llvm-project/llvm/lib/Support/Signals.cpp:106:18 #2 0x00000000004f7196 SignalHandler(int) /__w/clangd/clangd/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1 #3 0x00007f2920bc3580 (/lib/x86_64-linux-gnu/libc.so.6+0x3d580) #4 0x00000000012db453 operator< /__w/clangd/clangd/llvm-project/clang/include/clang/Basic/SourceLocation.h:199:31 #5 0x00000000012db453 operator() /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:61 #6 0x00000000012db453 partition_point<const clang::syntax::Token *, (lambda at /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:7)> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_algo.h:626:8 #7 0x00000000012db453 partition_point<llvm::ArrayRef<clang::syntax::Token>, (lambda at /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:390:7), const clang::syntax::Token &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1989:10 #8 0x00000000012db453 clang::syntax::TokenBuffer::spelledTokenAt(clang::SourceLocation) const /__w/clangd/clangd/llvm-project/clang/lib/Tooling/Syntax/Tokens.cpp:388:21 #9 0x0000000001462626 clang::clangd::collectMacroReferences(clang::clangd::ParsedAST&) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/IncludeCleaner.cpp:305:12 #10 0x0000000001462ae5 _Vector_impl /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:89:34 #11 0x0000000001462ae5 _Vector_base /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:127:9 #12 0x0000000001462ae5 vector /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:263:9 #13 0x0000000001462ae5 clang::clangd::computeIncludeCleanerFindings(clang::clangd::ParsedAST&) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/IncludeCleaner.cpp:367:39 #14 0x00000000014ae1e7 getIncludeCleanerDiags /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:376:7 #15 0x00000000014ae1e7 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, llvm::ArrayRef<clang::clangd::Diag>, std::shared_ptr<clang::clangd::PreambleData const>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:744:14 #16 0x000000000152e9b1 ~__shared_count /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:683:6 #17 0x000000000152e9b1 ~__shared_ptr /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/shared_ptr_base.h:1123:31 #18 0x000000000152e9b1 clang::clangd::(anonymous namespace)::ASTWorker::generateDiagnostics(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1210:39 #19 0x000000000152e44b clang::clangd::(anonymous namespace)::ASTWorker::updatePreamble(std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, clang::clangd::ParseInputs, std::shared_ptr<clang::clangd::PreambleData const>, std::vector<clang::clangd::Diag, std::allocator<clang::clangd::Diag>>, clang::clangd::WantDiagnostics)::$_2::operator()() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1144:5 #20 0x000000000152adf3 operator() /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12 #21 0x000000000152adf3 clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1324:3 #22 0x0000000001529860 run /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:1459:5 #23 0x0000000001529860 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/TUScheduler.cpp:822:42 #24 0x0000000001529860 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::(anonymous namespace)::ASTWorker::create(llvm::StringRef, clang::clangd::GlobalCompilationDatabase const&, clang::clangd::TUScheduler::ASTCache&, clang::clangd::TUScheduler::HeaderIncluderCache&, clang::clangd::AsyncTaskRunner*, clang::clangd::Semaphore&, clang::clangd::TUScheduler::Options const&, clang::clangd::ParsingCallbacks&)::$_7>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:221:12 #25 0x00000000016a22a1 operator= /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:48:5 #26 0x00000000016a22a1 PunnedPointer /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:37:60 #27 0x00000000016a22a1 PointerIntPair /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:86:13 #28 0x00000000016a22a1 UniqueFunctionBase /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:341:3 #29 0x00000000016a22a1 unique_function /__w/clangd/clangd/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:370:3 #30 0x00000000016a22a1 operator() /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:103:14 #31 0x00000000016a22a1 operator()<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:43:11 #32 0x00000000016a22a1 __invoke_impl<void, (lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:60:14 #33 0x00000000016a22a1 __invoke<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), (lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15) &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/invoke.h:95:14 #34 0x00000000016a22a1 __apply_impl<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &, 0> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1662:14 #35 0x00000000016a22a1 apply<(lambda at /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> &> /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/tuple:1671:14 #36 0x00000000016a22a1 GenericThreadProxy<std::tuple<(lambda at /__w/clangd/clangd/llvm-project/clang-tools-extra/clangd/support/Threading.cpp:98:15)> > /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:41:5 #37 0x00000000016a22a1 void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::$_1>>(void*) /__w/clangd/clangd/llvm-project/llvm/include/llvm/Support/thread.h:55:5 #38 0x00007f2920c0fdab start_thread ./nptl/pthread_create.c:444:8 #39 0x00007f2920c919f8 clone3 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0 Signalled during AST worker action: Build AST Filename: /mnt/d/debian_jessie_dev_folder/games/new_york_dev/g_engine/include/g_engine/animation.h Directory: /dev_share/games/new_york_dev//g_engine Command Line: /usr/lib/llvm-16/bin/clang++ --driver-mode=g++ -D_DEBUG_ -g3 -ggdb -g3 -fno-omit-frame-pointer -D_A20_ -fPIC -I./include -I/usr/include -I../global_utils/imgui_include -I../global_utils/imgui_include/sdl2 -I../global_utils/include -I../g_engine/include -I../g_engine/include/PCSC -I../g_engine/deps/include -I../g_engine/include/g_engine -I../g_engine/include/g_engine/kmsecure -I../board_subsystems/common/include -I../board_subsystems/a20_subsystem/deps/lib -I../c6a/include -I../cctalk/include -I../game_base/include -I../game_feature/include -I../game_utils/include -I../payengine/include -c -x c++-header -std=c++11 -resource-dir=/home/astor_dev/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/18.1.3/clangd_18.1.3/lib/clang/18 -- /mnt/d/debian_jessie_dev_folder/games/new_york_dev/g_engine/include/g_engine/animation.h Version: 1 [Error - 8:58:48 AM] The Clang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

AnonimiAngels avatar Sep 17 '24 07:09 AnonimiAngels

Thanks for checking. If you're able to share a code example that triggers the crash, that would be very helpful.

HighCommander4 avatar Sep 17 '24 19:09 HighCommander4

Thanks for checking. If you're able to share a code example that triggers the crash, that would be very helpful.

Ill strip what i cant share and ill repost taggin you

AnonimiAngels avatar Sep 18 '24 07:09 AnonimiAngels

Thanks for checking. If you're able to share a code example that triggers the crash, that would be very helpful.

Except the class definition there is no code except the includes, the class doesnt have templates, only definitions


#include <json/json.h>
#include <math.h>

#define LIBAVCODEC
#undef LIBVPX

extern "C"
{
#if defined(LIBVPX)
#include <vpx/vp8dx.h>
#include <vpx/vpx_decoder.h>
#elif defined(LIBAVCODEC)
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/error.h>
#include <libswscale/swscale.h>

#endif
}

#include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>

AnonimiAngels avatar Sep 18 '24 08:09 AnonimiAngels

Except the class definition [...]

There is no class definition in the posted code snippet. If the crash only occurs with a class definition present as well, you'll need to include that as well.

HighCommander4 avatar Sep 18 '24 20:09 HighCommander4

Except the class definition [...]

There is no class definition in the posted code snippet. If the crash only occurs with a class definition present as well, you'll need to include that as well.

Cant upload as .h ill share it as .log temp_hpp.log

AnonimiAngels avatar Sep 19 '24 14:09 AnonimiAngels

output_clangd.log clangd in verbose mode

AnonimiAngels avatar Sep 19 '24 14:09 AnonimiAngels

I have also been running into this with the latest release and SublimeText LSP. I am using the latest release:

~ ❯ clangd --version
Ubuntu clangd version 20.0.0 (++20240919051400+5e1a54b298d1-1~exp1~20240919051539.1937)
Features: linux+grpc
Platform: x86_64-pc-linux-gnu

Will try to provide some detail if I can find the right logs. Edit:

clangd: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
clangd:  #0 0x0000766d0b980a96 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-20/bin/../lib/libLLVM.so.20.0+0xf80a96)
clangd:  #1 0x0000766d0b97e690 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-20/bin/../lib/libLLVM.so.20.0+0xf7e690)
clangd:  #2 0x0000766d0b98114b (/usr/lib/llvm-20/bin/../lib/libLLVM.so.20.0+0xf8114b)
clangd:  #3 0x0000766d09a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
clangd:  #4 0x0000766d0b920e1d llvm::StringMapImpl::LookupBucketFor(llvm::StringRef, unsigned int) (/usr/lib/llvm-20/bin/../lib/libLLVM.so.20.0+0xf20e1d)
clangd:  #5 0x000061a1b9c4299c (/usr/bin/clangd+0x65899c)
clangd:  #6 0x000061a1b9c410ca (/usr/bin/clangd+0x6570ca)
clangd:  #7 0x000061a1ba24b91b (/usr/bin/clangd+0xc6191b)
clangd:  #8 0x000061a1b99c8867 (/usr/bin/clangd+0x3de867)
clangd:  #9 0x000061a1b9a6b5bc (/usr/bin/clangd+0x4815bc)
clangd: #10 0x000061a1b9a6afc4 (/usr/bin/clangd+0x480fc4)
clangd: #11 0x000061a1b9a679cc (/usr/bin/clangd+0x47d9cc)
clangd: #12 0x000061a1b9a6761f (/usr/bin/clangd+0x47d61f)
clangd: #13 0x000061a1b9bca9ba (/usr/bin/clangd+0x5e09ba)
clangd: #14 0x0000766d09a94ac3 start_thread ./nptl/pthread_create.c:442:8
clangd: #15 0x0000766d09b26850 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:83:0
clangd: Signalled during AST worker action: Build AST
clangd:   Filename: reference_checker.cpp
clangd:   Directory: p4c/build
clangd:   Command Line: /usr/lib/llvm-20/bin/clang++ --driver-mode=g++ -DBOOST_CONTAINER_NO_LIB -DBOOST_CONTAINER_STATIC_LINK -DBOOST_IOSTREAMS_NO_LIB -DBOOST_IOSTREAMS_STATIC_LINK -DBOOST_RANDOM_NO_LIB -DBOOST_RANDOM_STATIC_LINK -DCONFIG_PKGDATADIR="/usr/local/share/p4c" -DCONFIG_PREFIX="/usr/local" -DGC_USE_DLOPEN_WRAP -DMAX_LOGGING_LEVEL=10 -DP4C_GTEST_ENABLED -DSKIP_CPP_DEFINITIONS -D_GNU_SOURCE -Ip4c/build/control-plane -Ip4c -Ip4c/build -Ip4c/extensions -Ip4c/build/backends/p4tools/modules/flay/core/control_plane -Ip4c/build/backends/p4tools/common/control_plane -Ip4c/build/_deps/protobuf-src/src -Ip4c/build/_deps/bdwgc-src/include -isystem p4c/build/_deps/gtest-src/googlemock/include -isystem p4c/build/_deps/gtest-src/googletest/include -isystem p4c/build/_deps/z3-src/src/api -isystem p4c/build/_deps/z3-src/src/api/c++ -isystem p4c/build/_deps/abseil-src -isystem p4c/build/_deps/boost-src/libs/iostreams/include -isystem p4c/build/_deps/boost-src/libs/assert/include -isystem p4c/build/_deps/boost-src/libs/config/include -isystem p4c/build/_deps/boost-src/libs/core/include -isystem p4c/build/_deps/boost-src/libs/static_assert/include -isystem p4c/build/_deps/boost-src/libs/throw_exception/include -isystem p4c/build/_deps/boost-src/libs/detail/include -isystem p4c/build/_deps/boost-src/libs/preprocessor/include -isystem p4c/build/_deps/boost-src/libs/type_traits/include -isystem p4c/build/_deps/boost-src/libs/function/include -isystem p4c/build/_deps/boost-src/libs/bind/include -isystem p4c/build/_deps/boost-src/libs/integer/include -isystem p4c/build/_deps/boost-src/libs/iterator/include -isystem p4c/build/_deps/boost-src/libs/concept_check/include -isystem p4c/build/_deps/boost-src/libs/function_types/include -isystem p4c/build/_deps/boost-src/libs/mpl/include -isystem p4c/build/_deps/boost-src/libs/predef/include -isystem p4c/build/_deps/boost-src/libs/utility/include -isystem p4c/build/_deps/boost-src/libs/io/include -isystem p4c/build/_deps/boost-src/libs/fusion/include -isystem p4c/build/_deps/boost-src/libs/container_hash/include -isystem p4c/build/_deps/boost-src/libs/describe/include -isystem p4c/build/_deps/boost-src/libs/mp11/include -isystem p4c/build/_deps/boost-src/libs/tuple/include -isystem p4c/build/_deps/boost-src/libs/typeof/include -isystem p4c/build/_deps/boost-src/libs/functional/include -isystem p4c/build/_deps/boost-src/libs/optional/include -isystem p4c/build/_deps/boost-src/libs/move/include -isystem p4c/build/_deps/boost-src/libs/smart_ptr/include -isystem p4c/build/_deps/boost-src/libs/random/include -isystem p4c/build/_deps/boost-src/libs/array/include -isystem p4c/build/_deps/boost-src/libs/dynamic_bitset/include -isystem p4c/build/_deps/boost-src/libs/range/include -isystem p4c/build/_deps/boost-src/libs/conversion/include -isystem p4c/build/_deps/boost-src/libs/regex/include -isystem p4c/build/_deps/boost-src/libs/system/include -isystem p4c/build/_deps/boost-src/libs/variant2/include -isystem p4c/build/_deps/boost-src/libs/winapi/include -isystem p4c/build/_deps/boost-src/libs/format/include -isystem p4c/build/_deps/boost-src/libs/multiprecision/include -isystem p4c/build/_deps/boost-src/libs/lexical_cast/include -isystem p4c/build/_deps/boost-src/libs/container/include -isystem p4c/build/_deps/boost-src/libs/intrusive/include -isystem p4c/build/_deps/boost-src/libs/math/include -fdiagnostics-color=never -Wall -Wextra -Wno-overloaded-virtual -Wno-deprecated -Wno-deprecated-declarations -pedantic -Wno-gnu-zero-variadic-macro-arguments -O2 -g -DNDEBUG -fPIE -std=gnu++17 -o backends/p4tools/modules/flay/tools/CMakeFiles/flay_reference_checker.dir/reference_checker.cpp.o -c -resource-dir=/usr/lib/llvm-20/lib/clang/20 -- reference_checker.cpp
clangd:   Version: 0

fruffy avatar Sep 19 '24 16:09 fruffy

Except the class definition [...]

There is no class definition in the posted code snippet. If the crash only occurs with a class definition present as well, you'll need to include that as well.

Cant upload as .h ill share it as .log temp_hpp.log

Thanks, but now the file contains what I assume are #includes of header files from your project (<g_engine/common.h>).

To investigate the issue, a self-contained code example is needed. Something that I can copy-paste into my editor and reproduce the crash.

HighCommander4 avatar Sep 20 '24 03:09 HighCommander4

I have also been running into this with the latest release and SublimeText LSP. I am using the latest release:

@fruffy could you file a new issue please? "Crashing when parsing a header file" is a very generic symptom (there can be many reasons for a crash), and there's no particular reason to think your issue is the same as @AnonimiAngels'. It's easier to track separate issues in separate tickets (we can always dupe a ticket over to another if it turns out to be the same).

HighCommander4 avatar Sep 20 '24 03:09 HighCommander4

Thanks, but now the file contains what I assume are #includes of header files from your project (<g_engine/common.h>).

To investigate the issue, a self-contained code example is needed. Something that I can copy-paste into my editor and reproduce the crash.

Sadly i cant share it, but from clangd logs seems it crashes when parsing libswscale/swscale.h the first time

AnonimiAngels avatar Sep 20 '24 07:09 AnonimiAngels

I have also been running into this with the latest release and SublimeText LSP. I am using the latest release:

@fruffy could you file a new issue please? "Crashing when parsing a header file" is a very generic symptom (there can be many reasons for a crash), and there's no particular reason to think your issue is the same as @AnonimiAngels'. It's easier to track separate issues in separate tickets (we can always dupe a ticket over to another if it turns out to be the same).

Sure, done. #2151

fruffy avatar Sep 20 '24 11:09 fruffy