SUMMARY If KDevelop or the system crashes, hundreds of megabytes of temporary files are left behind in /temp, especially preamble-*.pch files. This can cause failure to boot the system due to low disk space, requiring manual cleaning of /tmp, sometimes from another distro, before even being able to boot. STEPS TO REPRODUCE 1. Use KDevelop 2. Experience a crash in KDevelop or general system. 3. Attempt to restart OBSERVED RESULT Cannot restart system because there is no disk space left. EXPECTED RESULT No junk in /tmp. SOFTWARE/OS VERSIONS OpenSUSE Tumbleweed ADDITIONAL INFORMATION Please make KDevelop check for stale temp files on startup and delete them before continuing. Because it is often when starting KDevelop again that the disk becomes full and then total chaos occurs. Note: Somewhat similar report is found in bug ID 378909 Thank you.
The same issue and a fix idea are described in two messages of this thread: https://mail.kde.org/pipermail/kdevelop-devel/2018-November/062135.html
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/283
Thanks for looking into this. Lately it seems to be behaving much better. Now at least, if a crash occurs, it seems that upon reboot the temp files are gone. I find that I am having to do much less manual cleanup than before. Thanks.
> Now at least, if a crash occurs, it seems that upon reboot the temp files are gone. By "reboot" do you mean system restart? I think /tmp is, and has been for years/decades, cleared when a GNU/Linux system starts.
Hm, you are right. I put a file in there and it was gone on reboot. It surely was not working at the time of this bug report. In fact at the time, Konsole was also leaving a lot of trash that was not cleared even on reboot, (the file dates and times proved this) so I filed a report with them as well, and they fixed leaving any trash at all. So that is why I was having so much trouble with KDevelop. On reboot tmp was not clearing KDevelop files, causing big trouble. I'm on SUSE Tumbleweed, so things just gradually fixed themselves. I wonder why it was not working before. I remember researching at the time whether tmp should be automatically cleared at all. Thanks for your help. A fan of KDevelop since the KDE2 days.
I suppose this report could be closed now, as the particular reported problem has gone away, with respect to the leftover reboot tmp files. Thank you.
No, I don't think it should be closed. I usually put my computer to sleep at night, reboot only once in a few weeks. So clearing the temporary files only on system reboot is not enough. My merge request clears these huge files on KDevelop start, so that they at least don't accumulate. Usually a user restarts KDevelop after it crashes to continue working, so clearing on start should be almost perfect.
Ah yes. Good idea I suppose, since we do still have to manually clear the temp files out after a non-lockup crash to the desktop. The trouble for me was when KDevelop occasionally crashed by locking up the computer, then I had all those temp files left over upon reboot. (I work on huge projects, maybe I need more RAM). But this 'leftover temp files upon reboot' problem seems to have gone away for me. Thanks.
Git commit a37c72dfd724a1bd2a587b46cc8a2ecf521d5001 by Igor Kushnir. Committed on 02/10/2023 at 19:50. Pushed by igorkushnir into branch 'master'. Clean up libclang's temporary files on KDevelop start I plan to place other temporary files created by KDevelop into the session temporary directory in the future. For example, KDevelop leaves behind many temporary kdevelop.* files after exit. Not all KDevelop tests remove their temporary files on exit. The session temporary directory use can be wrapped into convenient classes derived from QTemporaryDir and QTemporaryFile. Related: bug 378909 FIXED-IN: 5.13.231200 M +3 -0 kdevplatform/interfaces/icore.h M +75 -0 kdevplatform/shell/core.cpp M +1 -0 kdevplatform/shell/core.h M +2 -0 kdevplatform/shell/core_p.h M +47 -7 plugins/clang/duchain/clangindex.cpp https://invent.kde.org/kdevelop/kdevelop/-/commit/a37c72dfd724a1bd2a587b46cc8a2ecf521d5001