kpat stuffs hard drive

Bug #1851898 reported by Manos Sarris
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
kpat
Fix Released
Medium
kpat (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Confirmed
Undecided
Unassigned
Groovy
Fix Released
Undecided
Unassigned

Bug Description

Playing kpat after having finished/won a game the .xsession_errors in the home folder on KDE or the syslog in /var/log folder on other DEs become huge (about 5 GB per game).
I realised that when suddenly I got the message that my disk was full and syslog was about 35 GB.
I have managed to reproduce the error on live CD on Ubuntu, Kubuntu, Xubuntu, several times.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: kpat (not installed)
ProcVersionSignature: Ubuntu 5.3.0-21.22-generic 5.3.7
Uname: Linux 5.3.0-21-generic x86_64
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sat Nov 9 01:55:34 2019
InstallationDate: Installed on 2019-10-18 (21 days ago)
InstallationMedia: It
SourcePackage: kpat
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Ddppezas123 (ddppezas123) wrote :

SUMMARY
In the newer version of kpat (starting with Kubuntu 19.04), solver is much slower, hogs CPU, and logs a_lot to .xsession-errors (as much as 500K per second)

STEPS TO REPRODUCE
1. Start kpat.
2. Start a monitor for CPU and ~/.xsession-errors
3. Start a new game that stress the solver, like Mod3 or Spider

OBSERVED RESULT
Observe the too much logging, CPU hogging, and slow solver

EXPECTED RESULT
Solver should not log (so much?) calculations to ~/.xsession-errors (for non-debug?). Solver should be faster (like in older versions of Kubuntu) and not spend so much time Calculating...

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: Kubuntu 19.04
(available in About System)
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
You can reproduce this from a Kubuntu 19.04 Live CD

Bug doesn't happen in Freecell and maybe some other games, so probably is different than these two bugs: https://bugs.kde.org/show_bug.cgi?id=405187 and https://bugs.kde.org/show_bug.cgi?id=406094

Revision history for this message
In , trent stevenson (trentks) wrote :

Hi,

I also see a lot of logs to ~/.xsession-errors

I apologise to the maintainers, the fuzzy-search when I was submitting bug 409602 did not find this bug, but I have a similar issue (too many logs in `~/.xsession-error`?!? of all files, why not `/var/log/kpat/...`?).

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

*** Bug 409602 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Ddppezas123 (ddppezas123) wrote :

I can confirm this is still a bug in Kubuntu 19.10 released last month.

Can't run kpat games mod3 or spider unless a big hard drive for ~/.xsession-errors so disk won't full.

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: Kubuntu 19.10
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
You can reproduce this from a Kubuntu 19.10 Live CD

Revision history for this message
Manos Sarris (emmsarris) wrote :
description: updated
Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

You haven't provided any details as to what messages are being logged (I wonder if they aren't kpat messages, but something else that occurs during or due to game, eg. video or other driver messages etc).

I loaded a 'live' system (Lubuntu 20.04 because it was handy), installed `kpat` & tried playing a game (Klondike - you didn't provide game played; part of it was in 'demo' mode) watching via `du -hs /var/log` in a terminal for changes, but directory size remained static at 464K.

I booted the Kubuntu 19.10 ISO, and played another game of klondike. As before a good portion was in demo mode (more than half), but I reversed moves, and did other things players would likely do as in prior test. During this game (screen stopped at Congratulations! We have won) the size of /var/log/ didn't alter for either (using `du -hs` to monitor it during game in a terminal). I could not re-produce this issue. Possibly `kpat` is a trigger that causes messages from other packages to be created...

My ~/.xsession-errors did grow to 117M on Kubuntu 19.10 which does seem to relate to `kpat`, but it's not the 5GB you mentioned (you didn't specify a game, I chose my favorite Klondike)

I'm marking this "incomplete" as your report says you don't have `kpat` installed, thus no package details have been provided.

You've provided little detail as to what messages filled /var/log/; in fact neither my 19.10 Kubuntu test, nor Lubuntu 20.04 test output anything to /var/log/syslog so I suggest you look, and provide some detail. This will provide clues as to where the messages come from, if it's related to hardware (that differs from my own) and other packages that are involved.

Unfortunately, we cannot work on this bug because your description didn't include enough information. You may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem.

We have instructions on debugging some types of problems at http://wiki.ubuntu.com/DebuggingProcedures.

At a minimum, we need:
1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected.
3. The behavior you actually encountered (in as much detail as possible).
Thanks!

When you provide these details, please change status back to "New". If you believe I'm in error, or have overlooked something - please likewise return status to "New" and leave a comment explaining why. Thank you again for helping to make Ubuntu better.

Changed in kpat (Ubuntu):
status: New → Incomplete
Revision history for this message
Manos Sarris (emmsarris) wrote :

Hello. Thank you for your time. Here is the sequence.
Step 1. Load ubuntu 19.04 live usb
Step 2. Connect to wifi
Step 3. Open Nautilus /var/log
Step 4. Check syslog size (267 KB)
Step 5. Open Software and Update Sources to enable all sources
Step 6. From terminal: sudo apt update && sudo apt install kpat -y
Step 7. Open Kpat>Spider
Step 8. First move on game (syslog →115 MB)
This is where the cpu fan starts to run like crazy.
Step 9. At some point use ctrl+z to undo moves
Step 10. First row down (syslog→ 930 MB)
Step 11. Win game (syslog→ 2.1 GB)
I don’t know how or what causes this growth! Each time the size differs, but these are the 4 files I have kept as record to try make sense out of them. On another trial, during the second game I got the warning about disk size, and ignoring it stalled my system.

Revision history for this message
Manos Sarris (emmsarris) wrote :

On step 1, not 19.04, but 19.10.

Revision history for this message
Manos Sarris (emmsarris) wrote :

The syslog is full of lines like the following

Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: moves 7
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 1 to 4 (1) Prio: 13
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 6 from 2 to 0 (1) Prio: 66
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 3 to 4 (1) Prio: 13
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 9 to 6 (-1) Prio: 19
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 6 to 1 (1) Prio: 25
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 6 to 3 (1) Prio: 25
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: move 0 from 8 to 5 (1) Prio: 48
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: print-layout-begin
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play0:
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play1: |5H |7H KS
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play2: |9S |QH |2H |JS 7S
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play3: |7H |2H |KH |QS 8H 7H 6H 5H
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play4: |QH |JH |KH KH QS
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play5: |8H |7S |AS |AS 5H 4H 3H 2H
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play6: |TS |6H JS TS
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play7: |TS |QS |JH 5H 4S
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play8: |3H |KH |4H |AH 6S 5S 4S 3S 2S AS
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Play9: |4S |7S JH TH 9H 8S
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Deal0: |QS |3H |3S |KS |6S |5S |QH |TH |KS |4H
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Deal1: |6H |JH |5S |8S |2S |5S |9S |AH |AH |TH
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Deal2: |4S |TH |AH |9H |KS |9S |8S |6S |JS |6S
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Deal3: |9H |7S |QH |JS |8H |2S |2S |8H |3S |2H
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Deal4: |4H |6H |TS |9H |3S |3H |7H |8S |9S |AS
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: Off:
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: print-layout-end
Nov 9 06:15:27 it org.kde.kpat.desktop[2382]: moves 23

Rik Mills (rikmills)
Changed in kpat (Ubuntu):
status: Incomplete → Confirmed
Changed in kpat:
importance: Unknown → Medium
Revision history for this message
In , Coleclough-lucy (coleclough-lucy) wrote :

Hi there, I was going to report my error, but this resembles my bug closely enough.
I am on debian 11 testing with kPat 4.19
The solver fills up /var/log/messages insanely quickly, causes 100% cpu and fills up hd space.

Disabling prevents this issue

Revision history for this message
In , 8p-k26-gj (8p-k26-gj) wrote :

I can confirm with my distro-provided package on neon.

When I build it locally, I only get this issue on a Debug build, not on Release. So I wonder if maybe kpat gets built as debug build or some other non-Release configuration for some reason?

Revision history for this message
niconil (laurent-combe) wrote :

I can confirm with my distro-provided package kpat on a fresh Ubuntu 20.04

when playing spider

in few hours my /var/log/syslog is more than 60 GB !!! full of lines like in the comment #5

Revision history for this message
Owen (owen-ozone) wrote :

Operating System: Kubuntu 20.04
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-26-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-3770 CPU @ 3.40GHz
Memory: 15.6 GiB of RAM

KPat version: 19.12.3

When playing spider, ~/.xsession-errors fills up until disk out of space

eg:
    S 5S 4S 3S 2S AS
    Play8:
    Play9: |4S |QS JS TS 9S 8S 7S 6S 5S
    Deal0:

This game move data should never be stored in a system log file anyway, or any log file for that matter unless specifically requested with a debugging switch or something

Revision history for this message
niconil (laurent-combe) wrote :
Revision history for this message
In , Bernhard Rosenkraenzer (berolinux) wrote :

The problem is the fprintf(stderr) spewage in Solver::get_moves in patsolve/patsolve.cpp -- it's disabled only if built with -DNDEBUG.

For now we're fixing this in the OpenMandriva package by adding -DNDEBUG to the compiler flags. Given how much spewage it can cause (we found this bug after getting reports of a 20 GB xsession-errors.log), probably the #ifndef NDEBUG should be changed to something like #ifdef EXCESSIVE_DEBUG to fix it for everyone.

Revision history for this message
In , Bernhard Rosenkraenzer (berolinux) wrote :

Verified both the bug and the suggested fix from my previous comment in 20.04.1, changing version

Revision history for this message
dinosore (dinosore) wrote :

There is a simple work-around. Launch from a terminal and issue
<pre>
kpat 2>/dev/null
</pre>

Not ideal, but you're still stuffed if you run from the desktop.

I'm running 20.04 with standard gnome desktop.

Revision history for this message
niconil (laurent-combe) wrote :

thanks a lot.
i wrote a little script in my /usr/local/games/kpat
with your command and i use menulibre package to add a new launcher

i can now reuse kpat

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

Git commit 9b1d9abdc56f5037e713e1fdefa22e58d5c2087a by Albert Astals Cid.
Committed on 30/05/2020 at 17:16.
Pushed by aacid into branch 'release/20.04'.

Change some verbose debugs from using ifndef NDEBUG

Lots of distributions are building with DebugAndRelease configurations
to have better symbols and it seems this debug is *so* verbose that
floods people's disks with data

M +1 -1 dealer.cpp
M +1 -1 patsolve/patsolve.cpp

https://invent.kde.org/games/kpat/commit/9b1d9abdc56f5037e713e1fdefa22e58d5c2087a

Changed in kpat:
status: Unknown → Fix Released
Rik Mills (rikmills)
Changed in kpat (Ubuntu Focal):
status: New → Confirmed
Changed in kpat (Ubuntu Groovy):
status: Confirmed → Fix Committed
Rik Mills (rikmills)
Changed in kpat (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Michel-Ekimia (michel.ekimia) wrote :

Can the patch be backported to LTS ?

Using kpatience made some clients machine "soft bricked " as the syslog filled the disk ( 90 Gbytes ) in a few hours

Revision history for this message
Jani Jaakkola (jj-lousa) wrote :

Just had to clean on of my user's /var/log on 20.04 after they had played kpat. This still affects LTS users.

Revision history for this message
In , Y-coolo (y-coolo) wrote :

*** Bug 408708 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.