Bug 378294 - 100% Reproducible crash via static_assert()
Summary: 100% Reproducible crash via static_assert()
Status: RESOLVED DUPLICATE of bug 372215
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.3
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-30 23:36 UTC by fileoffset
Modified: 2017-03-31 07:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fileoffset 2017-03-30 23:36:55 UTC
When my KDevelop started crashing every time I opened my project up, I was pretty upset. I attached GDB and got a stack trace, and was surprised to see it was due to libclang trying to parse a static_assert().

Here is the stacktrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f01aa399700 (LWP 30610)]
0x00007f015ce19b5a in clang::cxcursor::MakeCXCursor(clang::Stmt const*, clang::Decl const*, CXTranslationUnitImpl*, clang::SourceRange) () from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
(gdb) bt
#0  0x00007f015ce19b5a in clang::cxcursor::MakeCXCursor(clang::Stmt const*, clang::Decl const*, CXTranslationUnitImpl*, clang::SourceRange) () from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#1  0x00007f015ce08f32 in clang::cxcursor::CursorVisitor::VisitStaticAssertDecl(clang::StaticAssertDecl*) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#2  0x00007f015ce01943 in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#3  0x00007f015ce01dfd in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#4  0x00007f015ce0587d in clang::cxcursor::CursorVisitor::handleDeclForVisitation(clang::Decl const*) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#5  0x00007f015ce05998 in clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#6  0x00007f015ce01b1b in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) ()
   from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#7  0x00007f015ce0a2b1 in clang_visitChildren () from /tmp/.mount_H1Q0rg/usr/lib/libclang.so.3.9
#8  0x00007f017c35a232 in Builder::visit(CXTranslationUnitImpl*, void*, QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool) () from /tmp/.mount_H1Q0rg/usr/lib/libKDevClangPrivate.so.25
#9  0x00007f017c38b3ac in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&)
    () from /tmp/.mount_H1Q0rg/usr/lib/libKDevClangPrivate.so.25
#10 0x00007f017c5eacf2 in ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) ()
   from /tmp/.mount_H1Q0rg/usr/lib/qt5/plugins/kdevplatform/25/kdevclangsupport.so
#11 0x00007f01d9146282 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#12 0x00007f01d9146bfe in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#13 0x00007f01d9145e7b in ThreadWeaver::Private::DefaultExecutor::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#14 0x00007f01d9146dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#15 0x00007f01d9145e1f in ThreadWeaver::Private::DebugExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#16 0x00007f01d9146dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#17 0x00007f01d9146d71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#18 0x00007f01d9146dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#19 0x00007f01d9146d71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#20 0x00007f01d9144ab7 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#21 0x00007f01d91486ed in ThreadWeaver::Collection::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#22 0x00007f01d914664b in ThreadWeaver::IdDecorator::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#23 0x00007f01d91443b1 in ThreadWeaver::Thread::run() () from /tmp/.mount_H1Q0rg/usr/lib/libKF5ThreadWeaver.so.5
#24 0x00007f01daf677f6 in ?? () from /tmp/.mount_H1Q0rg/usr/lib/libQt5Core.so.5
#25 0x00007f01d3416dc5 in start_thread () from /lib64/libpthread.so.0
#26 0x00007f01da3d173d in clone () from /lib64/libc.so.6

I found the offending static_assert and commented it out. This fixed the crash.

The static_assert was something I added to check a global variable in a library, it was:

static_assert(lcb_version_g >= 0x020506 && "This example requires 2.5.6 or greater");
Comment 1 Kevin Funk 2017-03-31 07:37:26 UTC
*** This bug has been marked as a duplicate of bug 372215 ***