From vscode on my KDE (Ubuntu 24.04) system when trying to open the "Save As" dialog to save any file, the dialog does not open and a separate process "kdialog" starts using 100% of CPU and tries to continuously allocating memory until it’s full and the system completely freezes.
Steps to reproduce (including clearing data and reinstalling vscode):
snap remove --purge code
rm -rf ~/.config/Code
rm -rf ~/.vscode
snap install code --classic
Open vscode (even with all extensions disabled and gpu acceleration turned off). Create new file. Try to save it.
When trying to save the new file, vscode starts an instance of kdialog with the following arguments:
kdialog --attach=75497476 --title="Save As" --getsavefilename /home/user/textfile "All Files (*.txt)|Plain Text (*.bat *.cmd) [...]"
This command if run separately runs properly, opens the dialog and returns in stdout the correct file path.
By trying to attach strace to the kdialog process (strace -f -p $(pgrep kdialog)
) it shows an infinite call of brk
kernel function, indicating its indeed continuously trying to extend the memory dedicated to the process.
Further investigation attaching gdb to the kdialog process it looks like the process is stuck in an infinite loop inside KBuildSycoca::recreate
. I’m not quite sure what "ksycoca" is doing but it looks like its related to a file in ~/.cache/.ksyscoca5*
, and indeed there is a .lock
file referring to kdialog
with the same pid. I even tried to clear those cache files but they gets recreated when kdialog is trying to start again.
Any idea on how to investigate further and how (and if) is this ksyscoca
involved in all this?
(kdialog version 23.08.5, vscode version 1.94.2 x64)
2
Answers
Same here (kdialog version 23.08.5, vscode version 1.94.2 x64)
The workaround mentioned here works for me: https://github.com/microsoft/vscode/issues/231310
File > Preferences > Settings > Text Editor > Files > Simple Dialog > Enable
The same problem here.
I don’t know whether the following observation can be of any use.
Only the updates of the last 2 weeks after fresh Kubuntu 24.04 LTS installation.
I encountered the problem with kdialog when I wanted to try out 2 python CAD modules.
I installed cadquery and aspose-cad with an active virtual environment.
Needless to say, I didn’t spend much time with the docs and just wanted to run some hello-world code.
https://github.com/CadQuery/cadquery
pip install cadquery
https://pypi.org/project/aspose-cad/
pip install aspose-cad
I noticed during the installation outputs that a lot of Qt 5 stuff was installed, although I thought I had Qt6 on my system.
Immediately after these unsuccessful installation attempts, I could no longer open the file/folder kdialog from within vscode. Complete vscode reinstallation did not change anything and since then I can only continue working with the ‘Simple Dialog > Enable’ method.