SVN Wesnoth crashes, major memory/processor issue

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
JimBass
Posts: 25
Joined: April 8th, 2006, 12:11 am

SVN Wesnoth crashes, major memory/processor issue

Post by JimBass »

Hello all!

First, I love this game!

Now the less pleasant stuff. I am running the SVN version of Wesnoth on Debian unstable, with a 2.6.18-1 kernel. I updated via svn update on Friday, November 10th. It now reports that my version is "At revision 14197".

Other things which according to the bug pages might be important -
automake is 1.9, compiled from source.
gcc version 4.1.2 20061028 (prerelease) (Debian 4.1.1-19)
wesnoth itself is the svn, I have to ./autogen.sh, ./configure, make, and sudo make install to use. No error ever occur during compilation, and I make clean before updating.

I am playing the Northern Rebirth campaign, and I'm on the 2nd scenario. While playing, the game will seem to get stuck on some random activity. This happened about 5 times tonight. First, it was having a bowman walk from point A to B. It happened once in combat. It frequently happens if I try to view profiles, or perform any "right click" action. When it locks up, I ssh in from another computer, get a reading from top of processor use at 17.45 or so, 256 Ram fully used, and 512 Mb of swap fully used. When I issue the command "kill -9 (wesnoth PID), it kills the game, and the processor, ram, and swap all drop down to normal within 10 seconds. kill -15 isn't strong enough, only kill -9 works.

The machine itself is useless, due to the strain it is under. The gui is useless, and the processor is under such strain, even trying ctrl-alt-f(x) to get a terminal outside of X takes forever. I have had the most luck sshing in (still a very lengthy process) and killing it that way.

I am attaching a save file, should anyone want to see if maybe it is just a corrupted save on my part. Here is the readout of what is happening from the terminal that I launch the game from:

showing title screen...
714074817
title screen returned result
found valid cache at '/home/jim/.wesnoth/cache/game.cfg-cache-v1.3-svn-CAMPAIGN_NORTHERN_REBIRTH-HARD' using it
scenario: 'infested_caves'
has snapshot: yes
setting replay to end...
scenario: 'infested_caves'
locale could not be determined; defaulting to system locale
locale could not be determined; defaulting to system locale
found valid cache at '/home/jim/.wesnoth/cache/game.cfg-cache-v1.3-svn-MEDIUM-NORMAL' using it
started music
714179266
showing title screen...
714179275
title screen returned result
found valid cache at '/home/jim/.wesnoth/cache/game.cfg-cache-v1.3-svn-CAMPAIGN_NORTHERN_REBIRTH-HARD' using it
scenario: 'infested_caves'
has snapshot: yes
setting replay to end...
scenario: 'infested_caves'
Turning an undo...
Turning an undo...
Killed

Please let me know if you need anymore info. The laptop itself has no problems, I use it both at work and at home all day every day.

Peace,
JimBass
Attachments
Infested_Caves_Turn_7.32.tar.bz2
Save from the game that crashes
(26.48 KiB) Downloaded 110 times
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Hello,
Thanks for reporting this.
We are aware of memory consumption problems in trunk.
It takes some time to find where those memory leak come from and fix them.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

Thanks for the report, I found the (partial) cause for the memory problems, read this bug report for the details https://gna.org/bugs/?7631. I notified the developer who's more familiar with this part of the code.
I haven't looked at the CPU usage.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Well the CPU usage might be a result of the memory usage : swap issues.... Or not.
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

Noyga wrote:Well the CPU usage might be a result of the memory usage : swap issues.... Or not.
When I looked for the memory problems I also tested versions which didn't have the memory problem. These versions still had a much higher cpu usage than 1.1.12 atm. 1.1.12 is at 2.3% when doing nothing, the SVN was IIRC around the 40% cpu usage.
JimBass
Posts: 25
Joined: April 8th, 2006, 12:11 am

Post by JimBass »

Thanks guys. I did see that report on the gna page, (by the way, your link didn't work for me, something about "unknown group" searching for 7631 turns it right up) but I didn't think it crept up as that describes. I'll play more today with both computers side by side. That way I can watch the memory and processor usage as things move along. My initial top report was something like this:

17.45 13.2 5.3

but later when I would catch it sooner, it would be more like:

13.6 5.3 2.3

indicating that it rapidly switches up. Also, I was able to play a good 30 or so minutes with no problems, then all of a sudden, something would happen and it would instantly be unusable.

In short, seems to me like it is some specific event(s) that cause the escalation, and not just that it continuously uses more and more memory. I will test and report my results here.

In any case, thanks again for everyone's work toward such a great game!

Peace,
JimBass
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

JimBass wrote:Thanks guys. I did see that report on the gna page, (by the way, your link didn't work for me, something about "unknown group" searching for 7631 turns it right up) but I didn't think it crept up as that describes.
I put a point behind the link... but here again https://gna.org/bugs/?7631

At my system it also doesn't always happen but sometimes, and it doesn't creep up it goes up with 60 MB per minute while doing nothing. I look forward to see you further findings.
JimBass
Posts: 25
Joined: April 8th, 2006, 12:11 am

Post by JimBass »

I stand corrected! It does creep up continuously for me as well. There are some strange things I noticed. If I hit ctrl-o or ctrl-s (open or save a game) the processor use will drop to 0. That seems to suggest (to my non-coding mind) that the problem is something in gameplay, as I have no problem with the title screen, or when play is suspended by the open/save dialog screne.

Attached is a series of screenshots, in .png format.

pregame.png is the output of htop before I start wesnoth, just to give a baseline.
creeping.png shows the memory usage skyrocket, and the processor starts going nuts
plateau.png is where the creep stopped, and actually processor use went down from 7+ to low 5
crazy.png is just that, processor use is 18.70!
post.png is the return to normal after the kill -9 took effect

The plateau was strange. While just watching, with the game on but no "playing" happening, the creep seemed to stop. It dropped from processor use over 7 back to the low 5 neighborhood, then started to creep up again.

Whenever the processor use was above 7, I couldn't play. Nothing I did had any effect.

Peace,
JimBass
Attachments
memoryleak.tar.bz2
screenshots of the htop readout through SSH to the computer playing wesnoth.
(430.02 KiB) Downloaded 131 times
viorc
Posts: 130
Joined: February 22nd, 2006, 3:03 am

Post by viorc »

SkeletonCrew wrote:I found the (partial) cause for the memory problems, read this bug report for the details https://gna.org/bugs/?7631. I notified the developer who's more familiar with this part of the code.
Just to report that the memory problem is hugely improved on the last SVN I got today (Revision: 14235). Thanks to everyone who made that possible ! :D
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

viorc wrote:Just to report that the memory problem is hugely improved on the last SVN I got today (Revision: 14235). Thanks to everyone who made that possible ! :D
Thanks for the info, I'll test tonight, yesterday I tested with build 14216 and it still had the problem, so the change must be very recent.
JimBass
Posts: 25
Joined: April 8th, 2006, 12:11 am

Post by JimBass »

I also build last night with 14235 and it does seem to be corrected!

Peace,
JimBass
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Ah, that would also explain why I could not reproduce this anymore here.. I thought I had just added a print call when I experienced it, but must have updated a few SVN revisions as well.
SkeletonCrew
Inactive Developer
Posts: 787
Joined: March 31st, 2006, 6:55 am

Post by SkeletonCrew »

Yes, the problem is solved I tested and these commits 14218 and 14222 fixed the problem.
Post Reply