Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::string clang::clangd::getDeclComment(const clang::ASTContext&, const clang::NamedDecl&): Assertion !Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc())' failed with -fmodules -fsanitize=address -march=native` #738

Open
davidstone opened this issue Apr 11, 2021 · 0 comments

Comments

@davidstone
Copy link

main.cpp

#include <version>

compile_commands.json

[
{
  "directory": "/home/david/test",
  "command": "clang++ -std=c++20 -stdlib=libc++ -fmodules -fsanitize=address -march=native -c main.cpp",
  "file": "main.cpp"
}
]

output

I[13:30:18.347] clangd version 13.0.0 (https://github.com/llvm/llvm-project.git f041757e9c2f7e343f5c4458797ee97687096020)
I[13:30:18.347] PID: 116948
I[13:30:18.347] Working directory: /home/david/test
I[13:30:18.347] argv[0]: clangd
I[13:30:18.347] argv[1]: --check=main.cpp
I[13:30:18.347] Entering check mode (no LSP server)
I[13:30:18.347] Testing on source file /home/david/test/main.cpp
I[13:30:18.347] Loading compilation database...
I[13:30:18.347] Loaded compilation database from /home/david/test/compile_commands.json
I[13:30:18.348] Compile command from CDB is: /home/david/llvm/build/bin/clang++ --driver-mode=g++ -std=c++20 -stdlib=libc++ -fmodules -fsanitize=address -march=native -c main.cpp -fsyntax-only -resource-dir=/home/david/llvm/build/lib/clang/13.0.0
I[13:30:18.348] Parsing command...
I[13:30:18.348] internal (cc1) args are: -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name main.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu znver2 -target-feature +sse2 -target-feature -tsxldtrk -target-feature +cx16 -target-feature +sahf -target-feature -tbm -target-feature -avx512ifma -target-feature +sha -target-feature -gfni -target-feature -fma4 -target-feature -vpclmulqdq -target-feature +prfchw -target-feature +bmi2 -target-feature -cldemote -target-feature +fsgsbase -target-feature -ptwrite -target-feature -amx-tile -target-feature -uintr -target-feature +popcnt -target-feature -widekl -target-feature +aes -target-feature -avx512bitalg -target-feature -movdiri -target-feature +xsaves -target-feature -avx512er -target-feature -avxvnni -target-feature -avx512vnni -target-feature -amx-bf16 -target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature +clwb -target-feature -avx512f -target-feature +xsavec -target-feature +clzero -target-feature -pku -target-feature +mmx -target-feature -lwp -target-feature +rdpid -target-feature -xop -target-feature +rdseed -target-feature -waitpkg -target-feature -kl -target-feature -movdir64b -target-feature +sse4a -target-feature -avx512bw -target-feature +clflushopt -target-feature +xsave -target-feature -avx512vbmi2 -target-feature +64bit -target-feature -avx512vl -target-feature -serialize -target-feature -hreset -target-feature -invpcid -target-feature -avx512cd -target-feature +avx -target-feature -vaes -target-feature -avx512bf16 -target-feature +cx8 -target-feature +fma -target-feature -rtm -target-feature +bmi -target-feature -enqcmd -target-feature +rdrnd -target-feature +mwaitx -target-feature +sse4.1 -target-feature +sse4.2 -target-feature +avx2 -target-feature +fxsr -target-feature +wbnoinvd -target-feature +sse -target-feature +lzcnt -target-feature +pclmul -target-feature -prefetchwt1 -target-feature +f16c -target-feature +ssse3 -target-feature -sgx -target-feature -shstk -target-feature +cmov -target-feature -avx512vbmi -target-feature -amx-int8 -target-feature +movbe -target-feature -avx512vp2intersect -target-feature +xsaveopt -target-feature -avx512dq -target-feature +adx -target-feature -avx512pf -target-feature +sse3 -debugger-tuning=gdb -fcoverage-compilation-dir=/home/david/test -resource-dir /home/david/llvm/build/lib/clang/13.0.0 -internal-isystem /home/david/llvm/build/bin/../include/c++/v1 -internal-isystem /home/david/llvm/build/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro -fdebug-compilation-dir=/home/david/test -ferror-limit 19 -fsanitize=address -fsanitize-system-blacklist=/home/david/llvm/build/lib/clang/13.0.0/share/asan_blacklist.txt -fsanitize-address-use-after-scope -fno-assume-sane-operator-new -fgnuc-version=4.2.1 -fmodules -fimplicit-module-maps -fmodules-cache-path=/home/david/.cache/clang/ModuleCache -fmodules-validate-system-headers -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ main.cpp
I[13:30:18.349] Building preamble...
I[13:30:18.359] Indexing headers...
clangd: /home/david/llvm/clang-tools-extra/clangd/CodeCompletionStrings.cpp:87: std::string clang::clangd::getDeclComment(const clang::ASTContext&, const clang::NamedDecl&): Assertion `!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc())' failed.
 #0 0x000055b56bd4421d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/david/llvm/build/bin/clangd+0x61821d)
 #1 0x000055b56bd42164 llvm::sys::RunSignalHandlers() (/home/david/llvm/build/bin/clangd+0x616164)
 #2 0x000055b56bd422d3 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f06d9180960 __restore_rt sigaction.c:0:0
 #4 0x00007f06d8bc5ef5 raise (/usr/lib/libc.so.6+0x3cef5)
 #5 0x00007f06d8baf862 abort (/usr/lib/libc.so.6+0x26862)
 #6 0x00007f06d8baf747 _nl_load_domain.cold loadmsgcat.c:0:0
 #7 0x00007f06d8bbe646 (/usr/lib/libc.so.6+0x35646)
 #8 0x000055b56c4034d1 (/home/david/llvm/build/bin/clangd+0xcd74d1)
 #9 0x000055b56c40350d clang::clangd::getDocComment[abi:cxx11](clang::ASTContext const&, clang::CodeCompletionResult const&, bool) (/home/david/llvm/build/bin/clangd+0xcd750d)
#10 0x000055b56c6ea03d clang::clangd::SymbolCollector::addDeclaration(clang::NamedDecl const&, clang::clangd::SymbolID, bool) (/home/david/llvm/build/bin/clangd+0xfbe03d)
#11 0x000055b56c6eacf1 clang::clangd::SymbolCollector::handleDeclOccurrence(clang::Decl const*, unsigned int, llvm::ArrayRef<clang::index::SymbolRelation>, clang::SourceLocation, clang::index::IndexDataConsumer::ASTNodeInfo) (/home/david/llvm/build/bin/clangd+0xfbecf1)
#12 0x000055b56cceb235 clang::index::IndexingContext::handleDeclOccurrence(clang::Decl const*, clang::SourceLocation, bool, clang::Decl const*, unsigned int, llvm::ArrayRef<clang::index::SymbolRelation>, clang::Expr const*, clang::Decl const*, clang::DeclContext const*) (/home/david/llvm/build/bin/clangd+0x15bf235)
#13 0x000055b56ccebad3 clang::index::IndexingContext::handleDecl(clang::Decl const*, clang::SourceLocation, unsigned int, llvm::ArrayRef<clang::index::SymbolRelation>, clang::DeclContext const*) (/home/david/llvm/build/bin/clangd+0x15bfad3)
#14 0x000055b56ccebbaa clang::index::IndexingContext::handleDecl(clang::Decl const*, unsigned int, llvm::ArrayRef<clang::index::SymbolRelation>) (/home/david/llvm/build/bin/clangd+0x15bfbaa)
#15 0x000055b56ccf6942 clang::declvisitor::Base<llvm::make_const_ptr, (anonymous namespace)::IndexingDeclVisitor, bool>::Visit(clang::Decl const*) IndexDecl.cpp:0:0
#16 0x000055b56ccf7818 clang::index::IndexingContext::indexDecl(clang::Decl const*) (/home/david/llvm/build/bin/clangd+0x15cb818)
#17 0x000055b56ccf78d5 clang::index::IndexingContext::indexDeclContext(clang::DeclContext const*) (/home/david/llvm/build/bin/clangd+0x15cb8d5)
#18 0x000055b56ccf786b clang::index::IndexingContext::indexDecl(clang::Decl const*) (/home/david/llvm/build/bin/clangd+0x15cb86b)
#19 0x000055b56cce9877 clang::index::indexTopLevelDecls(clang::ASTContext&, clang::Preprocessor&, llvm::ArrayRef<clang::Decl const*>, clang::index::IndexDataConsumer&, clang::index::IndexingOptions) (/home/david/llvm/build/bin/clangd+0x15bd877)
#20 0x000055b56c6b3fa5 clang::clangd::(anonymous namespace)::indexSymbols(clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, llvm::ArrayRef<clang::Decl*>, clang::clangd::MainFileMacros const*, clang::clangd::CanonicalIncludes const&, bool, llvm::StringRef, bool) FileIndex.cpp:0:0
#21 0x000055b56c6b55a9 clang::clangd::indexHeaderSymbols(llvm::StringRef, clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, clang::clangd::CanonicalIncludes const&) (/home/david/llvm/build/bin/clangd+0xf895a9)
#22 0x000055b56c6b569b clang::clangd::FileIndex::updatePreamble(llvm::StringRef, llvm::StringRef, clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, clang::clangd::CanonicalIncludes const&) (/home/david/llvm/build/bin/clangd+0xf8969b)
#23 0x000055b56bccbd9f std::_Function_handler<void (clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, clang::clangd::CanonicalIncludes const&), clang::clangd::(anonymous namespace)::Checker::buildAST()::'lambda'(clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, clang::clangd::CanonicalIncludes const&)>::_M_invoke(std::_Any_data const&, clang::ASTContext&, std::shared_ptr<clang::Preprocessor>&&, clang::clangd::CanonicalIncludes const&) Check.cpp:0:0
#24 0x000055b56c50681a clang::clangd::(anonymous namespace)::CppFilePreambleCallbacks::AfterExecute(clang::CompilerInstance&) Preamble.cpp:0:0
#25 0x000055b56cd80853 clang::PrecompiledPreamble::Build(clang::CompilerInvocation const&, llvm::MemoryBuffer const*, clang::PreambleBounds, clang::DiagnosticsEngine&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::shared_ptr<clang::PCHContainerOperations>, bool, clang::PreambleCallbacks&) (/home/david/llvm/build/bin/clangd+0x1654853)
#26 0x000055b56c50fb15 clang::clangd::buildPreamble(llvm::StringRef, clang::CompilerInvocation, clang::clangd::ParseInputs const&, bool, std::function<void (clang::ASTContext&, std::shared_ptr<clang::Preprocessor>, clang::clangd::CanonicalIncludes const&)>) (/home/david/llvm/build/bin/clangd+0xde3b15)
#27 0x000055b56bcd91ab clang::clangd::check(llvm::StringRef, llvm::function_ref<bool (clang::clangd::Position const&)>, clang::clangd::ThreadsafeFS const&, clang::clangd::ClangdLSPServer::Options const&) (/home/david/llvm/build/bin/clangd+0x5ad1ab)
#28 0x000055b56bc15c94 main (/home/david/llvm/build/bin/clangd+0x4e9c94)
#29 0x00007f06d8bb0b25 __libc_start_main (/usr/lib/libc.so.6+0x27b25)
#30 0x000055b56bc27f7e _start (/home/david/llvm/build/bin/clangd+0x4fbf7e)
fish: Job 1, 'clangd --check=main.cpp' terminated by signal SIGABRT (Abort)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant