Bug 389078

Summary: High CPU usage and possible freeze of the background parser
Product: [Applications] kdevelop Reporter: ichramm <jramirez.uy>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: NOR    
Version: 5.2.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Output of the commands top, htop, gdb, and strace

Description ichramm 2018-01-16 23:08:06 UTC
Created attachment 109918 [details]
Output of the commands top, htop, gdb, and strace

Kdevelop consumes a lot of CPU when opening most of my projects. It performs a little bit better with small projects (max 100 source files) but the high CPU usage is still there.

It is usually not possible to safely stop kdevelop, I have to kill it with SIGKILL because it won't honor other signals. 

In this case there are 2 threads responsible of the high CPU consumption, both have a similar stacktrace:


#0  0x00007f13260f13a5 in  () at /usr/lib/libclang.so.5
#1  0x00007f13260f3c22 in  () at /usr/lib/libclang.so.5
#2  0x00007f132610ed7e in  () at /usr/lib/libclang.so.5
#3  0x00007f1325ecdc9a in clang_getLocation () at /usr/lib/libclang.so.5
#4  0x00007f13279b1c6a in ClangProblem::ClangProblem(void*, CXTranslationUnitImpl*) () at /usr/lib/libKDevClangPrivate.so.30
#5  0x00007f13279b1580 in ClangProblem::ClangProblem(void*, CXTranslationUnitImpl*) () at /usr/lib/libKDevClangPrivate.so.30
#6  0x00007f13279bf58a in  () at /usr/lib/libKDevClangPrivate.so.30
#7  0x00007f132799c6a8 in ClangDiagnosticEvaluator::createProblem(void*, CXTranslationUnitImpl*) () at /usr/lib/libKDevClangPrivate.so.30
#8  0x00007f13279c336c in ParseSession::problemsForFile(void*) const () at /usr/lib/libKDevClangPrivate.so.30
#9  0x00007f13279a8142 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#10 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#11 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#12 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#13 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#14 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#15 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#16 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#17 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#18 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#19 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#20 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#21 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30
#22 0x00007f13279a77f8 in ClangHelpers::buildDUChain(...) () at /usr/lib/libKDevClangPrivate.so.30


I'm attaching a capture of top and htop and also the output of gdb and strace in order to show the strack trace and the syscalls the threads are performing.
Comment 1 Kevin Funk 2018-01-16 23:29:50 UTC

*** This bug has been marked as a duplicate of bug 386720 ***