Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

rdm crashed at completion #1428

Open zhihuiFan opened 2 years ago

zhihuiFan commented 2 years ago

Describe the bug I have used rtags for serval years and it works perfectly. However it start to crash often today and I don't know anything is changed. The core stack is below:

==105211== Invalid read of size 4
==105211==    at 0x7544B1F: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==121782==  Address 0x11f29060 is not stack'd, malloc'd or (recently) free'd
==121782== 
Caught signal 11

Here is the complete list of valgrind checking result before the crash.

/usr/local/bin/rc --current-file=/u01/yizhi/github/cstore2/src/backend/cstore/orc_bridge.c -b --unsaved-file=/u01/yizhi/github/cstore2/src/backend/cstore/orc_bridge.c:/tmp/r1mrO1 -z -t128 --code-complete-at /u01/yizhi/github/cstore2/src/backend/cstore/orc_bridge.c:29:2: --synchronous-completions --elisp --code-complete-prefix=init_orc_w
==105211== Thread 3:
==105211== Invalid read of size 8
==105211==    at 0x57C08E7: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Address 0x10e815e8 is 56 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 4
==105211==    at 0x7545230: non-virtual thunk to clang::ASTReader::ReadSLocEntry(int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0x10e8373c is 8,588 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 4
==105211==    at 0x7544A8C: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0x10e81828 is 632 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 8
==105211==    at 0x7544A93: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0x10e81820 is 624 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 4
==105211==    at 0x7544AC2: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0x10e81830 is 640 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 8
==105211==    at 0x7544B01: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0x10e81838 is 648 bytes inside a block of size 14,392 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x57F8E0C: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==    by 0xC322EDE: clone (in /usr/lib64/libc-2.24.so)
==105211== 
==105211== Invalid read of size 4
==105211==    at 0x7544B05: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0xcae6cac is 1,468 bytes inside a block of size 3,360 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x76120D7: clang::serialization::ModuleManager::~ModuleManager() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x7520322: clang::ASTReader::~ASTReader() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x752069C: non-virtual thunk to clang::ASTReader::~ASTReader() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x7615209: clang::serialization::ModuleManager::addModule(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, clang::serialization::ModuleFile*, unsigned int, long, long, clang::ASTFileSignature, clang::ASTFileSignature (*)(llvm::StringRef), clang::serialization::ModuleFile*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x752857E: clang::ASTReader::ReadASTCore(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, clang::serialization::ModuleFile*, llvm::SmallVectorImpl<clang::ASTReader::ImportedModule>&, long, long, clang::ASTFileSignature, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x7560200: clang::ASTReader::ReadAST(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, unsigned int, llvm::SmallVectorImpl<clang::ASTReader::ImportedSubmodule>*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F8F6F: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211== 
==105211== Invalid read of size 8
==105211==    at 0x7544B0C: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0xcae6cb8 is 1,480 bytes inside a block of size 3,360 free'd
==105211==    at 0x4C2F4C8: operator delete(void*) (vg_replace_malloc.c:586)
==105211==    by 0x76120D7: clang::serialization::ModuleManager::~ModuleManager() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x7520322: clang::ASTReader::~ASTReader() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x752069C: non-virtual thunk to clang::ASTReader::~ASTReader() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC081: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FC508: clang::CompilerInstance::~CompilerInstance() (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F3005: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6DC449C: ExecuteOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211==  Block was alloc'd at
==105211==    at 0x4C2E4AA: operator new(unsigned long) (vg_replace_malloc.c:344)
==105211==    by 0x7615209: clang::serialization::ModuleManager::addModule(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, clang::serialization::ModuleFile*, unsigned int, long, long, clang::ASTFileSignature, clang::ASTFileSignature (*)(llvm::StringRef), clang::serialization::ModuleFile*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x752857E: clang::ASTReader::ReadASTCore(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, clang::serialization::ModuleFile*, llvm::SmallVectorImpl<clang::ASTReader::ImportedModule>&, long, long, clang::ASTFileSignature, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x7560200: clang::ASTReader::ReadAST(llvm::StringRef, clang::serialization::ModuleKind, clang::SourceLocation, unsigned int, llvm::SmallVectorImpl<clang::ASTReader::ImportedSubmodule>*) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F8F6F: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, llvm::StringRef, bool, bool, clang::Preprocessor&, clang::ASTContext&, clang::PCHContainerReader const&, llvm::ArrayRef<std::shared_ptr<clang::ModuleFileExtension> >, clang::DependencyFileGenerator*, llvm::ArrayRef<std::shared_ptr<clang::DependencyCollector> >, void*, bool, bool, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57FE3F0: clang::CompilerInstance::createPCHExternalASTSource(llvm::StringRef, bool, bool, void*, bool) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5842A76: clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57F2FC4: clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, llvm::ArrayRef<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::MemoryBuffer*> >, bool, bool, bool, clang::CodeCompleteConsumer&, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImpl<clang::StoredDiagnostic>&, llvm::SmallVectorImpl<llvm::MemoryBuffer const*>&) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x555715A: clang_codeCompleteAt_Impl(CXTranslationUnitImpl*, char const*, unsigned int, unsigned int, llvm::ArrayRef<CXUnsavedFile>, unsigned int) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x5557C3B: void llvm::function_ref<void ()>::callback_fn<clang_codeCompleteAt::{lambda()#1}>(long) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5EC12: llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (in /usr/local/lib/libclang.so.7)
==105211==    by 0x6D5ED13: RunSafelyOnThread_Dispatch(void*) (in /usr/local/lib/libclang.so.7)
==105211== 
==105211== Invalid read of size 4
==105211==    at 0x7544B1F: clang::ASTReader::ReadSLocEntry(int) [clone .part.2196] (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C08EC: clang::SourceManager::loadSLocEntry(unsigned int, bool*) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C0C4B: clang::SourceManager::isOffsetInFileID(clang::FileID, unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x57C18AC: clang::SourceManager::getFileIDLoaded(unsigned int) const (in /usr/local/lib/libclang.so.7)
==105211==    by 0x557BCE1: clang_getSpellingLocation (in /usr/local/lib/libclang.so.7)
==105211==    by 0x42D6C3: RTags::DiagnosticsProvider::createLocation(CXSourceLocation const&, bool*, unsigned int*) (RTags.h:291)
==105211==    by 0x428FBF: RTags::DiagnosticsProvider::diagnose() (RTags.cpp:830)
==105211==    by 0x4F100B: CompletionThread::processDiagnostics(CompletionThread::Request const*, CXCodeCompleteResults*, CXTranslationUnitImpl*) (CompletionThread.cpp:862)
==105211==    by 0x4EBB09: CompletionThread::process(CompletionThread::Request*) (CompletionThread.cpp:431)
==105211==    by 0x4E5243: CompletionThread::run() (CompletionThread.cpp:111)
==105211==    by 0x5A697D: Thread::localStart(void*) (Thread.cpp:23)
==105211==    by 0xB2296C9: start_thread (in /usr/lib64/libpthread-2.24.so)
==105211==  Address 0xe6c9ed8 is not stack'd, malloc'd or (recently) free'd
==105211== 
Caught signal 11
rdm[0x413b06]
/usr/lib64/libpthread.so.0(+0x115d0)[0xb2335d0]
/usr/lib64/libpthread.so.0(raise+0x7d)[0xb23347d]
/usr/local/lib/libclang.so.7(+0x1f23b30)[0x6d5eb30]
/usr/lib64/libpthread.so.0(+0x115d0)[0xb2335d0]
/usr/local/lib/libclang.so.7(+0x2709b1f)[0x7544b1f]
/usr/local/lib/libclang.so.7(+0x9858ed)[0x57c08ed]
/usr/local/lib/libclang.so.7(+0x985c4c)[0x57c0c4c]
/usr/local/lib/libclang.so.7(+0x9868ad)[0x57c18ad]
/usr/local/lib/libclang.so.7(clang_getSpellingLocation+0x1e2)[0x557bce2]
rdm[0x42d6c4]
rdm[0x428fc0]
rdm[0x4f100c]
rdm[0x4ebb0a]
rdm[0x4e5244]
rdm[0x5a697e]
/usr/lib64/libpthread.so.0(+0x76ca)[0xb2296ca]
/usr/lib64/libc.so.6(clone+0x5f)[0xc322edf]
==105211== 
==105211== HEAP SUMMARY:
==105211==     in use at exit: 25,278,368 bytes in 206,819 blocks
==105211==   total heap usage: 691,305 allocs, 484,486 frees, 174,621,703 bytes allocated
==105211== 
==105211== LEAK SUMMARY:
==105211==    definitely lost: 0 bytes in 0 blocks
==105211==    indirectly lost: 0 bytes in 0 blocks
==105211==      possibly lost: 608 bytes in 2 blocks
==105211==    still reachable: 25,277,760 bytes in 206,817 blocks
==105211==         suppressed: 0 bytes in 0 blocks
==105211== Rerun with --leak-check=full to see details of leaked memory
==105211== 
==105211== For lists of detected and suppressed errors, rerun with: -s
==105211== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)

Environment (please complete the following information):

Thanks for the creating the great product for free!

zhihuiFan commented 2 years ago

For any user who run into the same issue, can try the following command to workaround it, it works for me at least.

rdm --completion-diagnostics=off ...
root42 commented 2 years ago

Thank you, same problem is happening here as well. And the workaround helps, for now. But I guess there needs to be a proper fix.

root42 commented 2 years ago

Hm, I don't get any flycheck diagnostics anymore. Is this related to the completion-diagnostics setting being off? This is a bit annoying... Did anyone ever figure out why this whole thing crashes?

aschmitz-crnc commented 1 year ago

@Andersbakken I had a short look but am not fluent enough in clang API, so I have no clue why the crash happens. But is there a chance this can be fixed? Currently I am manually compiling rtags with clang-9 to still be able to use it. But it would be nice if I could switch to clang-13 eventually, as the newer clangs have better support of the more recent C++ standards.