llvm / llvm-project

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

clangd crashes on c++ modules involved project. #82180

Open paveltrpn opened 9 months ago

paveltrpn commented 9 months ago

I build a recent clang 18.1.0rc boundle, and it have broke my neovim editing pipeline - clangd crashes on startup on c++ modules based project. On old plain source/header pipeline everything works fine. Previous build based on bab01aea works quite fine.

clangd version 18.1.0rc (https://github.com/llvm/llvm-project.git 82e17c153611fbb8c5bb9b990f0f143910a4c2e0)

" #0 0x000055741b579f62 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/clangd+0x800f62)\n

1 0x000055741b576f8b SignalHandler(int) Signals.cpp:0:0\n

2 0x00007f8d1f642990 (/lib/x86_64-linux-gnu/libc.so.6+0x42990)\n

3 0x000055741d74e8d7 clang::ASTReader::DecodeIdentifierInfo(unsigned int) (/usr/local/bin/clangd+0x29d58d7)\n #4 0x000055741d75fd85 clang::ASTRecordReader::readNestedNameSpecifierLoc() (/usr/local/bin/clangd+0x29e6d85)\n

5 0x000055741d76016e clang::TypeLocReader::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) (/usr/local/bin/clangd+0x29e716e)\n

6 0x000055741d767846 clang::ASTRecordReader::readTypeLoc(clang::TypeLoc, clang::SourceLocationSequence*) (/usr/local/bin/clangd+0x29ee846)\n

7 0x000055741d7a7e5e clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2ee5e)\n

8 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

9 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

10 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

11 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

12 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

13 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

14 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

15 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

16 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

17 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

18 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

19 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

20 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

21 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

22 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

23 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

24 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

25 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

26 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

27 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

28 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

29 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

30 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

31 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

32 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

33 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

34 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

35 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

36 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

37 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

38 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

39 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

40 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

41 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

42 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

43 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

44 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

45 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

46 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

47 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

48 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

49 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

50 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

51 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

52 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

53 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

54 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

55 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

56 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

57 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

58 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

59 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

60 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

61 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

62 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

63 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

64 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

65 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

66 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

67 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

68 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

69 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

70 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

71 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

72 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

73 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

74 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

75 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

76 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

77 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

78 0x000055741d7a60e6 clang::ASTDeclReader::Visi"

"tFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

79 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

80 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

81 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n

82 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n

83 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n

84 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n

85 0x000055741d6fcb73 clang::ASTReader::GetDecl(unsigned int) (.part.0) ASTReader.cpp:0:0\n

86 0x000055741d737015 clang::ASTReader::InitializeSema(clang::Sema&) (/usr/local/bin/clangd+0x29be015)\n

87 0x000055741bf49021 clang::Sema::Initialize() (/usr/local/bin/clangd+0x11d0021)\n

88 0x000055741d844281 clang::Parser::Initialize() (/usr/local/bin/clangd+0x2acb281)\n

89 0x000055741d842103 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/clangd+0x2ac9103)\n

90 0x000055741d4807d9 clang::FrontendAction::Execute() (/usr/local/bin/clangd+0x27077d9)\n

91 0x000055741c9003cb clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_delete>, llvm::ArrayRef, std::shared_ptr) (/usr/local/bin/clangd+0x1b873cb)\n

92 0x000055741c9834b9 clang::clangd::(anonymous namespace)::ASTWorker::generateDiagnostics(std::unique_ptr<clang::CompilerInvocation, std::default_delete>, clang::clangd::ParseInputs, std::vector<clang::clangd::Diag, std::allocator>) TUScheduler.cpp:0:0\n

93 0x000055741c9840a2 clang::clangd::(anonymous namespace)::ASTWorker::updatePreamble(std::unique_ptr<clang::CompilerInvocation, std::default_delete>, clang::clangd::ParseInputs, std::shared_ptr, std::vector<clang::clangd::Diag, std::allocator>, clang::clangd::WantDiagnostics)::'lambda'()::operator()() TUScheduler.cpp:0:0\n

94 0x000055741c97b5da clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) (.constprop.0) TUScheduler.cpp:0:0\n

95 0x000055741c97be25 clang::clangd::(anonymous namespace)::ASTWorker::run() TUScheduler.cpp:0:0\n

96 0x000055741cb41957 void llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::'lambda0'()>>(void) Threading.cpp:0:0\n

97 0x00007f8d1f697b5a start_thread ./nptl/pthread_create.c:444:8\n

98 0x00007f8d1f7285fc clone3 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0\nSignalled during AST worker action: Build AST\n Filename: /mnt/main_disk/code/tiny-render/geometry/Basics.cpp\n Directory: /mnt/main_disk/code/tiny-render/build\n Command Line: /usr/local/bin/clang++ --driver-mode=g++ -I/mnt/main_disk/code/tiny-render/../extern_libs/libjpeg/include -I/mnt/main_disk/code/tiny-render/../extern_libs/libtga/include -I/mnt/main_disk/code/tiny-render/../extern_libs/glfw/include -I/mnt/main_disk/code/tiny-render/../extern_libs/glew/include -I/mnt/main_disk/code/tiny-render/../extern_libs/json/include -std=c++23 -g -O0 -Wall -Wextra -Wpedantic -stdlib=libc++ -Wno-unused-parameter -x c++-module -fmodule-output=CMakeFiles/geometry.dir/geometry-Basics.pcm -fmodule-file=toy_std=CMakeFiles/toy_std.dir/toy_std.pcm -fmodule-file=toy_std.algebra=CMakeFiles/toy_std.dir/toy_std.algebra.pcm -fmodule-file=toy_std.algebra:matrix=CMakeFiles/toy_std.dir/toy_std.algebra-matrix.pcm -fmodule-file=toy_std.algebra:quaternion=CMakeFiles/toy_std.dir/toy_std.algebra-quaternion.pcm -fmodule-file=toy_std.algebra:vector=CMakeFiles/toy_std.dir/toy_std.algebra-vector.pcm -fmodule-file=toy_std.algorithm=CMakeFiles/toy_std.dir/toy_std.algorithm.pcm -fmodule-file=toy_std.array=CMakeFiles/toy_std.dir/toy_std.array.pcm -fmodule-file=toy_std.concepts=CMakeFiles/toy_std.dir/toy_std.concepts.pcm -fmodule-file=toy_std.iterator_traits=CMakeFiles/toy_std.dir/toy_std.iterator_traits.pcm -fmodule-file=toy_std.raw_list=CMakeFiles/toy_std.dir/toy_std.raw_list.pcm -fmodule-file=toy_std.raw_vector=CMakeFiles/toy_std.dir/toy_std.raw_vector.pcm -fmodule-file=toy_std.stack=CMakeFiles/toy_std.dir/toy_std.stack.pcm -fmodule-file=toy_std.vector=CMakeFiles/toy_std.dir/toy_std.vector.pcm -o CMakeFiles/geometry.dir/geometry/Basics.cpp.o -c -resource-dir=/usr/local/lib/clang/18 -- /mnt/main_disk/code/tiny-render/geometry/Basics.cpp\n Version: 0\n"

llvmbot commented 9 months ago

@llvm/issue-subscribers-clangd

Author: Pavel (paveltrpn)

I build a recent clang 18.1.0rc boundle, and it have broke my neovim editing pipeline - clangd crashes on startup on c++ modules based project. On old plain source/header pipeline everything works fine. Previous build based on bab01aea works quite fine. clangd version 18.1.0rc (https://github.com/llvm/llvm-project.git 82e17c153611fbb8c5bb9b990f0f143910a4c2e0) " #0 0x000055741b579f62 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/clangd+0x800f62)\n #1 0x000055741b576f8b SignalHandler(int) Signals.cpp:0:0\n #2 0x00007f8d1f642990 (/lib/x86_64-linux-gnu/libc.so.6+0x42990)\n #3 0x000055741d74e8d7 clang::ASTReader::DecodeIdentifierInfo(unsigned int) (/usr/local/bin/clangd+0x29d58d7)\n #4 0x000055741d75fd85 clang::ASTRecordReader::readNestedNameSpecifierLoc() (/usr/local/bin/clangd+0x29e6d85)\n #5 0x000055741d76016e clang::TypeLocReader::VisitElaboratedTypeLoc(clang::ElaboratedTypeLoc) (/usr/local/bin/clangd+0x29e716e)\n #6 0x000055741d767846 clang::ASTRecordReader::readTypeLoc(clang::TypeLoc, clang::SourceLocationSequence*) (/usr/local/bin/clangd+0x29ee846)\n #7 0x000055741d7a7e5e clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2ee5e)\n #8 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #9 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #10 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #11 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #12 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #13 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #14 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #15 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #16 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #17 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #18 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #19 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #20 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #21 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #22 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #23 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #24 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #25 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #26 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #27 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #28 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #29 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #30 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #31 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #32 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #33 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #34 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #35 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #36 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #37 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #38 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #39 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #40 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #41 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #42 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #43 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #44 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #45 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #46 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #47 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #48 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #49 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #50 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #51 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #52 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #53 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #54 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #55 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #56 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #57 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #58 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #59 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #60 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #61 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #62 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #63 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #64 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #65 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #66 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #67 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #68 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #69 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #70 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #71 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #72 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #73 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #74 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #75 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #76 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #77 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #78 0x000055741d7a60e6 clang::ASTDeclReader::Visi" "tFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #79 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #80 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #81 0x000055741d738862 clang::ASTReader::GetDecl(unsigned int) (/usr/local/bin/clangd+0x29bf862)\n #82 0x000055741d7a60e6 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*) (/usr/local/bin/clangd+0x2a2d0e6)\n #83 0x000055741d7a7df5 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/local/bin/clangd+0x2a2edf5)\n #84 0x000055741d7a8925 clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/local/bin/clangd+0x2a2f925)\n #85 0x000055741d6fcb73 clang::ASTReader::GetDecl(unsigned int) (.part.0) ASTReader.cpp:0:0\n #86 0x000055741d737015 clang::ASTReader::InitializeSema(clang::Sema&) (/usr/local/bin/clangd+0x29be015)\n #87 0x000055741bf49021 clang::Sema::Initialize() (/usr/local/bin/clangd+0x11d0021)\n #88 0x000055741d844281 clang::Parser::Initialize() (/usr/local/bin/clangd+0x2acb281)\n #89 0x000055741d842103 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/clangd+0x2ac9103)\n #90 0x000055741d4807d9 clang::FrontendAction::Execute() (/usr/local/bin/clangd+0x27077d9)\n #91 0x000055741c9003cb 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>) (/usr/local/bin/clangd+0x1b873cb)\n #92 0x000055741c9834b9 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>>) TUScheduler.cpp:0:0\n #93 0x000055741c9840a2 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)::'lambda'()::operator()() TUScheduler.cpp:0:0\n #94 0x000055741c97b5da clang::clangd::(anonymous namespace)::ASTWorker::runTask(llvm::StringRef, llvm::function_ref<void ()>) (.constprop.0) TUScheduler.cpp:0:0\n #95 0x000055741c97be25 clang::clangd::(anonymous namespace)::ASTWorker::run() TUScheduler.cpp:0:0\n #96 0x000055741cb41957 void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::'lambda0'()>>(void*) Threading.cpp:0:0\n #97 0x00007f8d1f697b5a start_thread ./nptl/pthread_create.c:444:8\n #98 0x00007f8d1f7285fc clone3 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:80:0\nSignalled during AST worker action: Build AST\n Filename: /mnt/main_disk/code/tiny-render/geometry/Basics.cpp\n Directory: /mnt/main_disk/code/tiny-render/build\n Command Line: /usr/local/bin/clang++ --driver-mode=g++ -I/mnt/main_disk/code/tiny-render/../extern_libs/libjpeg/include -I/mnt/main_disk/code/tiny-render/../extern_libs/libtga/include -I/mnt/main_disk/code/tiny-render/../extern_libs/glfw/include -I/mnt/main_disk/code/tiny-render/../extern_libs/glew/include -I/mnt/main_disk/code/tiny-render/../extern_libs/json/include -std=c++23 -g -O0 -Wall -Wextra -Wpedantic -stdlib=libc++ -Wno-unused-parameter -x c++-module -fmodule-output=CMakeFiles/geometry.dir/geometry-Basics.pcm -fmodule-file=toy_std=CMakeFiles/toy_std.dir/toy_std.pcm -fmodule-file=toy_std.algebra=CMakeFiles/toy_std.dir/toy_std.algebra.pcm -fmodule-file=toy_std.algebra:matrix=CMakeFiles/toy_std.dir/toy_std.algebra-matrix.pcm -fmodule-file=toy_std.algebra:quaternion=CMakeFiles/toy_std.dir/toy_std.algebra-quaternion.pcm -fmodule-file=toy_std.algebra:vector=CMakeFiles/toy_std.dir/toy_std.algebra-vector.pcm -fmodule-file=toy_std.algorithm=CMakeFiles/toy_std.dir/toy_std.algorithm.pcm -fmodule-file=toy_std.array=CMakeFiles/toy_std.dir/toy_std.array.pcm -fmodule-file=toy_std.concepts=CMakeFiles/toy_std.dir/toy_std.concepts.pcm -fmodule-file=toy_std.iterator_traits=CMakeFiles/toy_std.dir/toy_std.iterator_traits.pcm -fmodule-file=toy_std.raw_list=CMakeFiles/toy_std.dir/toy_std.raw_list.pcm -fmodule-file=toy_std.raw_vector=CMakeFiles/toy_std.dir/toy_std.raw_vector.pcm -fmodule-file=toy_std.stack=CMakeFiles/toy_std.dir/toy_std.stack.pcm -fmodule-file=toy_std.vector=CMakeFiles/toy_std.dir/toy_std.vector.pcm -o CMakeFiles/geometry.dir/geometry/Basics.cpp.o -c -resource-dir=/usr/local/lib/clang/18 -- /mnt/main_disk/code/tiny-render/geometry/Basics.cpp\n Version: 0\n"
d-hain commented 4 months ago

Also happening for me on version 18.1.3 (c13b7485b87909fcf739f62cfa382b55407433c0) Code itself works when compiling with clang++ version 16.06 (15~deb12u1)

Maybe also related to #97688

Neovim Lsp crash log:

[START][2024-07-08 23:13:46] LSP logging initiated
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "The flag `-inlay-hints` is obsolete and ignored.\nI[23:13:48.236] clangd version 18.1.3 (https://github.com/llvm/llvm-project c13b7485b87909fcf739f62cfa382b55407433c0)\nI[23:13:48.236] Features: linux+grpc\nI[23:13:48.236] PID: 185785\nI[23:13:48.236] Working directory: /home/dhain/NAS-David/Programming/BobsTD\nI[23:13:48.236] argv[0]: /home/dhain/.local/share/nvim/mason/bin/clangd\nI[23:13:48.236] argv[1]: --pch-storage=memory\nI[23:13:48.236] argv[2]: --completion-style=detailed\nI[23:13:48.236] argv[3]: --header-insertion=never\nI[23:13:48.236] argv[4]: --background-index\nI[23:13:48.236] argv[5]: --all-scopes-completion\nI[23:13:48.236] argv[6]: --header-insertion-decorators\nI[23:13:48.236] argv[7]: --function-arg-placeholders\nI[23:13:48.236] argv[8]: --inlay-hints\nI[23:13:48.236] argv[9]: --pretty\nI[23:13:48.236] Starting LSP over stdin/stdout\nI[23:13:48.237] <-- initialize(1)\nI[23:13:48.238] --> reply:initialize(1) 1 ms\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.724] <-- initialized\nI[23:13:48.724] <-- textDocument/didOpen\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.726] Loaded compilation database from /home/dhain/NAS-David/Programming/BobsTD/compile_commands.json\nI[23:13:48.726] --> window/workDoneProgress/create(0)\nI[23:13:48.726] Enqueueing 2 commands for indexing\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.726] ASTWorker building file /home/dhain/NAS-David/Programming/BobsTD/src/main.cpp version 0 with command \n[/home/dhain/NAS-David/Programming/BobsTD/build]\n/usr/lib/llvm-16/bin/clang++-16 --driver-mode=g++ -c -Wall -Wextra -Werror -Wpedantic -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-language-extension-token -Wno-missing-braces -std=c++20 -stdlib=libc++ -fmodules -fbuiltin-module-map -fprebuilt-module-path=. -resource-dir=/home/dhain/.local/share/nvim/mason/packages/clangd/clangd_18.1.3/lib/clang/18 -- /home/dhain/NAS-David/Programming/BobsTD/src/main.cpp\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.732] <-- textDocument/semanticTokens/full(2)\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.732] <-- reply(0)\nI[23:13:48.732] --> $/progress\nI[23:13:48.732] --> $/progress\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.738] Built preamble of size 224084 for file /home/dhain/NAS-David/Programming/BobsTD/src/main.cpp version 0 in 0.01 seconds\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.739] --> workspace/semanticTokens/refresh(1)\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.741] Indexing c++20 standard library in the context of /home/dhain/NAS-David/Programming/BobsTD/src/main.cpp\nI[23:13:48.743] --> $/progress\nI[23:13:48.743] --> $/progress\nI[23:13:48.743] --> $/progress\nI[23:13:48.743] --> $/progress\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.763] <-- $/cancelRequest\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.763] <-- textDocument/semanticTokens/full(3)\nI[23:13:48.763] <-- reply(1)\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.765] <-- textDocument/documentHighlight(4)\n"
[ERROR][2024-07-08 23:13:48] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:48.842] <-- textDocument/signatureHelp(5)\n"
[ERROR][2024-07-08 23:13:50] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:50.326] Indexed c++20 standard library (incomplete due to errors): 1144 symbols, 1028 filtered\n"
[ERROR][2024-07-08 23:13:51] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:51.393] --> textDocument/publishDiagnostics\n"
[ERROR][2024-07-08 23:13:51] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "I[23:13:51.394] --> reply:textDocument/semanticTokens/full(2) 2661 ms, error: Task was cancelled.\nI[23:13:51.394] --> reply:textDocument/semanticTokens/full(3) 2630 ms\nI[23:13:51.394] --> reply:textDocument/documentHighlight(4) 2628 ms\n"
[ERROR][2024-07-08 23:13:51] .../vim/lsp/rpc.lua:734    "rpc"   "/home/dhain/.local/share/nvim/mason/bin/clangd"    "stderr"    "PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.\nStack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):\n0  clangd    0x00000000004f680b\n1  clangd    0x00000000004f464e\n2  clangd    0x00000000004f7196\n3  libc.so.6 0x00007fbb04e8a1a0\n4  clangd    0x000000000051a4a9\n5  clangd    0x0000000001e4aac7\n6  clangd    0x0000000001ee5764\n7  clangd    0x0000000001e4ee67\n8  clangd    0x0000000001e5a52f\n9  clangd    0x0000000000517033\n10 clangd    0x00000000005170f4\n11 clangd    0x000000000051710a\n12 libc.so.6 0x00007fbb04ed632c\n13 libc.so.6 0x00007fbb04f574c8\n"