Bug 463926 - Kdevelop frequently pauses for many seconds while editing Python files
Summary: Kdevelop frequently pauses for many seconds while editing Python files
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: 5.10.221200
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-06 13:42 UTC by Aaron Williams
Modified: 2023-01-11 23:11 UTC (History)
1 user (show)

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


Attachments
Complete stack trace (65.74 KB, text/plain)
2023-01-06 13:42 UTC, Aaron Williams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Williams 2023-01-06 13:42:15 UTC
Created attachment 155074 [details]
Complete stack trace

SUMMARY
I am trying to edit some Python files but every few lines, almost randomly, Kdevelop will just completely freeze and consume 100% CPU and will not respond to any input. The mouse cursor disappears over Kdevelop as well, and usually not just the editor part.

STEPS TO REPRODUCE
1.  Open large project with a mixture of C and Python
2.  Open files to edit
3.  Try to edit files

OBSERVED RESULT
Frequently there are very long pauses in Kdevelop, often lasting a minute or more with the CPU pegged at 100%.  I do not see much, if any, disk I/O while this is happening and the entire project is stored on a fast M.2 drive. There also is no shortage of memory since the machine in question has 128GIB of RAM.

Other applications run smoothly while this is happening and there are no dmesg messages indicating any problems.
The project is also using GIT.

It may be due to an issue with code completion. One problem I have experienced for a LONG time is the fact that KDevelop will always hang and consume 100% of the CPU indefinitely if I attempt to close it and the process must be externally killed. I understand that this is due to some data structure corruption that is happening. That issue has been going on for at least a year!

EXPECTED RESULT
I expect the editor to behave smoothly

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version:  5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
I have attached a stack trace of all threads while it is in this hung state.  After a minute or so it will resume.
Comment 1 Aaron Williams 2023-01-06 13:43:25 UTC
If needed I can provide my project and settings files, though the project itself is closed source and cannot be shared.
Comment 2 Sven Brauch 2023-01-06 13:52:10 UTC
Your backtrace shows that the hanging occurs because the "Rename" assistant waits for a lock on the language model, but doesn't get it quickly. Why this happens in your particular project I unfortunately don't know.

Can you install more complete debug symbols for kdevplatform? From your trace it's unfortunately not clear what the thread which is probably holding that lock is doing in the meantime.
Comment 3 Aaron Williams 2023-01-11 10:13:33 UTC
I will try and do this after the next time I log out/reboot since the debug info available is slightly newer than what I have installed. This project consists of only Python (3.6.15) and Makefiles.
Comment 4 Aaron Williams 2023-01-11 10:16:39 UTC
Also, I was mistaken about the size of the project. It's actually fairly small with only a few thousand lines of Python split across around a dozen files. I was confusing it from a different project (which this is a rewrite of) that also contains a lot of C code.

My system has Python 2.7.18, Python 3.6.15, and Python 3.10.8, but the system default is 3.6.15 and these files are strictly Python3.
Comment 5 Aaron Williams 2023-01-11 23:11:56 UTC
It looks like I had the kdevplatform debug symbols installed. One thing that was not installed is the Kdevelop Python module. I am seeing some slowdowns, but not like before. I think the previous pauses increased the longer KDevelop was in use. I will get another trace when it begins to lag again, though this might be a while since I will be out of town for the next few days.