Bug 407841 - Kdevelop crashes with a segmentation fault when parsing my project
Summary: Kdevelop crashes with a segmentation fault when parsing my project
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 5.3.2
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-22 18:59 UTC by Gus Fernandez
Modified: 2025-03-15 09:08 UTC (History)
5 users (show)

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


Attachments
Kdevelop backtrace (500.73 KB, application/octet-stream)
2020-09-15 12:23 UTC, Andreas Nordal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gus Fernandez 2019-05-22 18:59:48 UTC
SUMMARY

I started trying to use KDevelop 5.3.2 on Centos 7 running KDE.
While background parsing my existing C++ project, the main KDevelop window disappears and I get a segmentation fault.

/tmp/.mount_KDevelLq3RAG/AppRun: line 36: 48806 Segmentation fault      (core dumped) kdevelop $@

No other information.

STEPS TO REPRODUCE
1. Launch KDevelop
2. Open a project to my existing source directory
3. Wait while it parses the file.

OBSERVED RESULT

KDevelop disappears and the console where I opened it shows "/tmp/.mount_KDevelLq3RAG/AppRun: line 36: 48806 Segmentation fault      (core dumped) kdevelop $@"

EXPECTED RESULT

No crash


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
Centos 7

KDE Plasma Version: 4.14.8
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

How can I get more information to you?
Comment 1 Andreas Nordal 2020-09-15 12:23:37 UTC
Created attachment 131672 [details]
Kdevelop backtrace
Comment 2 Andreas Nordal 2020-09-15 14:03:20 UTC
I have the same symptom with Kdevelop 5.6.0 – sigsegv when parsing the project.

I ran kdevelop in gdb to get the backtrace. I did this 3 times to see if it segfaults at the same place every time, and it seems so: clang::InjectedClassNameType::getDecl in tools/clang/lib/AST/Type.cpp:3387

This happens in an extremely deep recursion inside libclang-10: The two functions TransformTypos::RecursiveTransformLoop and TransformTypos::CheckForRecursiveTypos are running in tandem 23214 or 20548 times (not the same every time) before calling the series of functions that lead to the segfault.
Comment 3 Roman Zimmermann 2020-11-11 22:38:55 UTC
I don’t have a backtrace, but for me it fails when opening a Python project while parsing the site-packages. Interestingly it fails when IPython is installed, but it doesn’t when I uninstall it. (gentoo, kdevelop 5.6.0)
Comment 4 Francis Herne 2020-11-11 22:57:59 UTC
The last comment is probably https://bugs.kde.org/show_bug.cgi?id=426292, and unrelated to the original report.
Comment 5 David Roman 2024-04-04 14:36:25 UTC
I'm using kdevelop 5.13.240201 and it crashes for me. Some months ago it crashed and I solved it by removing the cache and kdevelop project files and starting from zero. Then it crashed again. Today while I was building the project and changing some files it crashed and now every time I open the problematic project it crashes.

It also seems to be related with clang, from gdb backtrace:

#0  0x00007fffbdec44d0 in clang_getFileContents () at /usr/lib/llvm/17/lib64/libclang.so.17
#1  0x00007fffc79c7188 in ClangUtils::getRawContents (unit=unit@entry=0x7ffe9c009a40, range=...)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/util/clangutils.cpp:345
#2  0x00007fffc79b0e34 in (anonymous namespace)::fixitsForDiagnostic (diagnostic=diagnostic@entry=0x7ffec059e570, unit=unit@entry=0x7ffe9c009a40)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/clangproblem.cpp:63
#3  0x00007fffc79b175c in ClangProblem::ClangProblem (this=0x7ffec0a9e540, diagnostic=0x7ffec059e570, unit=0x7ffe9c009a40)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/clangproblem.cpp:154
#4  0x00007fffc79b1a15 in ClangProblem::ClangProblem (this=this@entry=0x7ffec0a9c7e0, diagnostic=diagnostic@entry=0x7ffec059eb60, unit=unit@entry=0x7ffe9c009a40)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/clangproblem.cpp:164
#5  0x00007fffc79c1422 in UnknownDeclarationProblem::UnknownDeclarationProblem
    (this=this@entry=0x7ffec0a9c7e0, diagnostic=diagnostic@entry=0x7ffec059eb60, unit=unit@entry=0x7ffe9c009a40)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/unknowndeclarationproblem.cpp:535
#6  0x00007fffc79a423d in ClangDiagnosticEvaluator::createProblem (diagnostic=diagnostic@entry=0x7ffec059eb60, unit=0x7ffe9c009a40)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/clangdiagnosticevaluator.cpp:108
#7  0x00007fffc79b9efc in ParseSession::getOrCreateProblem (this=this@entry=0x7fff53dffac8, indexInTU=indexInTU@entry=9, diagnostic=diagnostic@entry=0x7ffec059eb60)
    at /var/tmp/portage/dev-util/kdevelop-24.02.1/work/kdevelop-24.02.1/plugins/clang/duchain/parsesession.cpp:501