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

YCM (libclang.so) crash #244

Closed
wdl83 opened this issue Apr 12, 2013 · 2 comments
Closed

YCM (libclang.so) crash #244

wdl83 opened this issue Apr 12, 2013 · 2 comments

Comments

@wdl83
Copy link

wdl83 commented Apr 12, 2013

Hi,

I'm using latest (1b4eb61) version of YCM and
I encountered a 100% crashable situation with YCM (which gives such trace):
#0 0x00007ffff6cba475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6cbd6f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6 ++j)
#2 0x00007ffff6cb3621 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff52652ea in clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#4 0x00007ffff4be62c4 in EmitUnknownDiagWarning(clang::DiagnosticsEngine&, llvm::StringRef, llvm::StringRef, bool) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#5 0x00007ffff4be5b9d in clang::ProcessWarningOptions(clang::DiagnosticsEngine&, clang::DiagnosticOptions const&) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#6 0x00007ffff4b9e8aa in clang::ASTUnit::CodeComplete(llvm::StringRef, unsigned int, unsigned int, std::pair<std::string, llvm::PointerUnion<char const*, llvm::MemoryBuffer const*> >, unsigned int, bool, bool, bool, clang::CodeCompleteConsumer&, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::FileManager&, llvm::SmallVectorImplclang::StoredDiagnostic&, llvm::SmallVectorImpl<llvm::MemoryBuffer const>&) ()

from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#7 0x00007ffff49f5d61 in clang_codeCompleteAt_Impl () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#8 0x00007ffff52eee72 in llvm::CrashRecoveryContext::RunSafely(void ()(void), void*) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#9 0x00007ffff52eefe4 in RunSafelyOnThread_Dispatch(void*) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#10 0x00007ffff530823a in ExecuteOnThread_Dispatch(void*) () from /home/vlad/.vim/bundle/YouCompleteMe/autoload/../python/libclang.so
#11 0x00007ffff7018b50 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0rd);
#12 0x00007ffff6d62a7d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x0000000000000000 in ?? ()

Could you suggest how can I try to dig it deeper?
Thanks.

@wdl83
Copy link
Author

wdl83 commented Apr 12, 2013

It looks like const DiagnosticConsumer is not set:

const DiagnosticConsumer* clang::DiagnosticsEngine::getClient ( ) const;

bool DiagnosticsEngine::EmitCurrentDiagnostic(bool Force) {
assert(getClient() && "DiagnosticClient not set!");

bool Emitted;
if (Force) {
Diagnostic Info(this);

// Figure out the diagnostic level of this message.
DiagnosticIDs::Level DiagLevel
  = Diags->getDiagnosticLevel(Info.getID(), Info.getLocation(), *this);

Emitted = (DiagLevel != DiagnosticIDs::Ignored);
if (Emitted) {
  // Emit the diagnostic regardless of suppression level.
  Diags->EmitDiag(*this, DiagLevel);
}

} else {
// Process the diagnostic, sending the accumulated information to the
// DiagnosticConsumer.
Emitted = ProcessDiag();
}

// Clear out the current diagnostic object.
unsigned DiagID = CurDiagID;
Clear();

// If there was a delayed diagnostic, emit it now.
if (!Force && DelayedDiagID && DelayedDiagID != DiagID)
ReportDelayed();

return Emitted;
}

Wlodek

PS: how to properly insert source code into github comments?

@Valloric
Copy link
Member

This is a Clang bug, not a YCM bug. Please report it on the Clang issue tracker.

bijancn pushed a commit to bijancn/YouCompleteMe that referenced this issue Jul 26, 2016
Added GoTo include file functionality

Added GoToInclude sub-command for c family languages.
Changed logic to use paths specified with -iquote flag only for quoted includes. (https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html)
Added unit tests for new functionality.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/244)
<!-- Reviewable:end -->
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants