Bug 372215 - Crash while parsing static_assert
Summary: Crash while parsing static_assert
Status: RESOLVED UPSTREAM
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.2
Platform: Arch Linux Linux
: HI crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 378294 383612 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-08 14:05 UTC by OlafLostViking
Modified: 2017-08-17 07:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OlafLostViking 2016-11-08 14:05:12 UTC
By putting a "static_assert( true );" into a minimal file skeleton, KDevelop crashes with SIG11.

The crash handler shows the following backtrace:

Thread 13 (Thread 0x7f1dc53fa700 (LWP 19454)):
[KCrash Handler]
#6  0x00007f1da52523de in  () at /usr/lib/libclang.so.3.9
#7  0x00007f1da5235302 in  () at /usr/lib/libclang.so.3.9
#8  0x00007f1da52333f0 in  () at /usr/lib/libclang.so.3.9
#9  0x00007f1da52339a5 in  () at /usr/lib/libclang.so.3.9
#10 0x00007f1da52395ac in  () at /usr/lib/libclang.so.3.9
#11 0x00007f1da52398c0 in  () at /usr/lib/libclang.so.3.9
#12 0x00007f1da5233314 in  () at /usr/lib/libclang.so.3.9
#13 0x00007f1da523c154 in clang_visitChildren () at /usr/lib/libclang.so.3.9
#14 0x00007f1dc4192408 in  () at /usr/lib/libKDevClangPrivate.so.25
#15 0x00007f1da5233975 in  () at /usr/lib/libclang.so.3.9
#16 0x00007f1da5237c76 in  () at /usr/lib/libclang.so.3.9
#17 0x00007f1da52333f0 in  () at /usr/lib/libclang.so.3.9
#18 0x00007f1da523c154 in clang_visitChildren () at /usr/lib/libclang.so.3.9
#19 0x00007f1dc4181577 in  () at /usr/lib/libKDevClangPrivate.so.25
#20 0x00007f1dc4193504 in  () at /usr/lib/libKDevClangPrivate.so.25
#21 0x00007f1da5233975 in  () at /usr/lib/libclang.so.3.9
#22 0x00007f1da5232ebd in  () at /usr/lib/libclang.so.3.9
#23 0x00007f1da5232fe2 in  () at /usr/lib/libclang.so.3.9
#24 0x00007f1da523360c in  () at /usr/lib/libclang.so.3.9
#25 0x00007f1da523c154 in clang_visitChildren () at /usr/lib/libclang.so.3.9
#26 0x00007f1dc4175424 in Builder::visit(CXTranslationUnitImpl*, void*, QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool) () at /usr/lib/libKDevClangPrivate.so.25
#27 0x00007f1dc41a3b1a in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&) () at /usr/lib/libKDevClangPrivate.so.25
#28 0x00007f1dcc0820a9 in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevclangsupport.so
#29 0x00007f1e0c314586 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#30 0x00007f1e0c314b88 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#31 0x00007f1e0c313a9a in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#32 0x00007f1e0c313140 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#33 0x00007f1e17a11d78 in  () at /usr/lib/libQt5Core.so.5
#34 0x00007f1e10bf5454 in start_thread () at /usr/lib/libpthread.so.0
#35 0x00007f1e173277df in clone () at /usr/lib/libc.so.6
Comment 1 Eugene Shalygin 2016-11-23 23:07:03 UTC
Same here with Git master branch. Setting -std=c++1z in Language Support for C/C++ Parser does not help. Have to type every static_assert starting with ("") :)
Comment 2 Kevin Funk 2016-11-24 09:36:33 UTC
Upstream issue in Clang 3.9.0. 

Also see: https://github.com/Valloric/YouCompleteMe/issues/2364#issuecomment-251336248

Apparently fixed here:
https://github.com/llvm-mirror/clang/commit/e3a335ebd724f0ee206658bd19c571bdd5204c15

Can't reproduce with LLVM/Clang from trunk. I'll check if above commit will be backported to 3.9 branch (it currently isn't in there).
Comment 3 Kevin Funk 2016-11-24 09:39:36 UTC
Okay, this got backported:
https://github.com/llvm-mirror/clang/commit/28ec0503d504acb7b4040e8b3e77a01c36bf14a4

So this issue should be fixed as soon as you upgrade to libclang from Clang/LLVM 3.9.1.
Comment 4 Kevin Funk 2017-03-31 07:37:26 UTC
*** Bug 378294 has been marked as a duplicate of this bug. ***
Comment 5 Kevin Funk 2017-08-17 07:17:37 UTC
*** Bug 383612 has been marked as a duplicate of this bug. ***