Wesnoth keeps crashing

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:
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Is this related?

Post by Dave »

Sithrandel wrote:
Star Gazer wrote:This usually occurs after prolongued playing with many saves. This is in OS 10.2.8. I'm going to try some games in OS 10.3.4 to see if I can replicate the problem, and eliminate my system from the equation.
Anything surfacing only after prolonged play tends to suggest memory leaks / pointer corruption. The OS comparison would be useful though.
Actually what this sounds like it might be is a file descriptor leak. In most OSes, you can only have a certain number of files opened at once. This means that if your program opens files and 'forgets' to close them, eventually you won't be able to open files anymore.

Since saving requires opening files, as does loading an image [1], these things might fail under such condition.

I have done an audit of the Wesnoth file opening code though, and can't see how Wesnoth could possibly leak file descriptors when opening files: RAII [2] is strictly used, and the file descriptor has a very small scope.

Other alternative possibilities that could cause file desciptor exhaustion that I can think of are,

- Wesnoth fails to clean up network socket connections properly. A socket connection uses a file descriptor. Star Gazer, does this happen in multiplayer/networked games, or in single player?
- There is a file descriptor leak in SDL. Perhaps only on OSX.
- There is a file descriptor leak in another program on Star Gazer's system.

Star_Gazer, do any of these possibilities make any sense to you as to the possible cause of the problem?

Is the game generally stable other than images not displaying properly, and the game not being saveable?

David

[1] Wesnoth generally caches images in memory, but it does sometimes have to invalidate the cache and reload them from files.
[2] Resource Acquisition Is Initialization, a technique popularized by Bjarne Stroustrup for managing resources effectively in C++
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Star Gazer
Posts: 110
Joined: April 6th, 2004, 10:06 am
Location: North Norfolk, UK

Post by Star Gazer »

Hi Dave, sorry about the long delay, life intruded.

I haven't really explored multiplayer much, the fault I've had is in the single-player game.

There seems no other problems with the game other than the problems I have already described. I wish I had run it under developer's tools as well, but I haven't had sufficient time to get XCode sorted and running.

I'm going to try and explore the console records and see if I can spot any sign of what is happening, but I suspect it may not be visible.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Star Gazer wrote:Hi Dave, sorry about the long delay, life intruded.
Under 12 hours is fast enough for me! :)
Star Gazer wrote: I'm going to try and explore the console records and see if I can spot any sign of what is happening, but I suspect it may not be visible.
Okay. If the game has failed to open an image you will see something like, "Error: could not open image '<image-path>'".

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

(Mac OS X 10.3.3, Wesnoth 0.8 )

This never happens to me the first time I start up BfW after starting up the computer.

This happens a lot when I have the cfg files open in a text editor when I start up BfW. It doesn't crash that time, but next time I try to start it up.

Even when I don't have any of the files open, it sometimes happens when I've been editing them a lot (and starting up and quitting BfW to change them, so I don't know if editing them is relevant.) However they have had a lot of potentially buggy WML, and I don't know whether that's relevant. (I found out a way to get the equivalent of a two-dimensional array in WML, eventually. :o 8) )
Play a Silver Mage in the Wesvoid campaign.
DoctorJ
Posts: 40
Joined: July 12th, 2004, 4:54 pm
Location: Redlands, California

Re: Is this related?

Post by DoctorJ »

Star Gazer wrote:Hi guys,

I don't know if this isn't a completely different phenomenon, but I have been getting a curious hiccup where it stops saving games when you finish your turn, and you can't manually save either, and then a unit may become 'invisible', but the AI can see it even if you can't!

This usually occurs after prolongued playing with many saves. This is in OS 10.2.8. I'm going to try some games in OS 10.3.4 to see if I can replicate the problem, and eliminate my system from the equation.

Has anyone else had this quirk?

Here's my story: running Wesnoth binary 0.8 on an iMac [X.2.8] & a PowerBook [X.3.4]. I played several scenarios of "Heir To The Throne" on the iMac; "The Dark Hordes" on the PowerBook. They ran as expected; i saved each turn religiously. The problem occured when i transferred the savefiles from the iMac to the PowerBook, then loaded the beginning of "Muff Malal's Peninsula".

Neither auto save nor manual save would work. I didn't stick around long enough to verify the presence of invisible units. I had a hunch [I played in Full Screen on the iMac, Windowed on the PowerBook]. When i changed the preferences from Windowed to Full Screen, Wesnoth crashed ["The application has quit unexpectedly"]!

I had an opportunity to send a status report to Apple, but declined. Do they forward such to other developers, or what? Or should i have copied the report for sending to you guys?? Anyway, the kicker is that after restarting Wesnoth & reloading the scenario, it plays just fine.

It would seem that the problem is not to be found in the savefile, but rather that Wesnoth's memory pool is somehow getting corrupted... In the short run, the solution is to just reboot Wesnoth whenever problems develop.

[EDIT] I can now confirm that this has nothing to do w/ transferring save files or changing resolution. I started a new campaign, on this computer, kept the same resolution (windowed), had the same problem after a while of not being able to save. It also wouldn't load a save file (claiming "there are no save files to load").

It seems to creep in after an extended period of manual saves & reloads - perhaps something in the file requestor? I now quit Wesnoth whenever i'm not using it, rather than my old procedure of just minimizing it to the dock. BTW, i still haven't witnessed the invisible unit effect, but have always quit soon after i see problems...
Post Reply