Resource leak in gnome-mahjongg (leads to 100% CPU)
gnome-mahjongg 3.38.3
Playing multiple games slowly causes gnome-mahjongg to use more and more CPU. This was noticed when it caused an old laptop (MXLinux 19.4 x32) to become hot - gnome-mahjongg was 100% CPU at all times, including paused. It has also been reproduced on modern x64 hardware and distro.
This is not a simple function of time (leaving the game running doesn't increase usage). I have not investigated further whether it's completing games, clicking tiles etc.
# Run on start and after each game (no user activity while tracing)
$ sudo timeout 10s strace -p `pgrep gnome-mahjongg` 2>/tmp/mahjongg.1.strace.txt
$ sudo lsof -p `pgrep gnome-mahjongg` > /tmp/mahjongg.1.lsof.txt
# lsof shows a steady state
# strace shows increasing volumes of syscalls
$ wc -l /tmp/mah*
137 /tmp/mahjongg.1.lsof.txt
3 /tmp/mahjongg.1.strace.txt
137 /tmp/mahjongg.2.lsof.txt
1686 /tmp/mahjongg.2.strace.txt
137 /tmp/mahjongg.3.lsof.txt
2197 /tmp/mahjongg.3.strace.txt
137 /tmp/mahjongg.4.lsof.txt
2998 /tmp/mahjongg.4.strace.txt
138 /tmp/mahjongg.5.lsof.txt
5370 /tmp/mahjongg.5.strace.txt