When trying to open the "Save As" dialog to save any file in Visual Studio Code on KDE (Ubuntu 24.04, 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 VS Code):
snap remove --purge code
rm -rf ~/.config/Code
rm -rf ~/.vscode
snap install code --classic
Open VS Code (even with all extensions disabled and GPU acceleration turned off). Create a new file and try to save it.
When trying to save the new file, VS Code 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 it's 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 process ID (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, VS Code version 1.94.2 x64)