News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Load error for savegame created in 9.2 with Pak.Britain-Ex

Started by TheUniqueTiger, January 06, 2011, 10:20:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TheUniqueTiger

Hello,
I wish to report an error I get while loading a savegame created in 9.2 with Pak.Britain-Ex 0.7.1. The error message appears when the load progress bar reaches more than half, and always at the same point. Its a new map with most default settings except for starting money 200 million, with just an electrified rail track, two platforms and an electric depot, no trains yet. I haven't even renamed anything. Before electrification, with just tracks on the map & no platforms or depot, the game saves & loads fine. Same error message existed in 9.1 as well with savegame created in 9.1. I'm using Win7 x64.

Error message:

FATAL ERROR:
loadsave_t::rdwr_str()
string longer (65535) than
allowed size (128)
PRESS ANY KEY


If required I can attach the savegame as well.

Thanks!

jamespetts

Thank you very much for your report. It might help if you were to upload a saved game, but I suspect that it won't tell me where the problem occurred as there would be some error in saving.

To be clear - are you saying that you created a game in 9.1 and it failed when trying to load it in 9.1; then you created a game with 9.2, saved it, and it also failed when trying to load it in 9.2?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

I tried out sdog's massive game and get something similar in 148 save game.
the only part that is different is string longer (22728)

oddly enough, it doesn't happen in 153.
In 156 I get a constant "Bus or car stops must be placed on road tiles" error message.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

jamespetts

AEO,

Sdog's earlier saved games were saved with a pre-release version of 9.0 the saved games of which are not compatible with the released versions.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ӔO

aha, I suspected it was due to an incompatibility between a self compiled and official release versions.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

sdog


TheUniqueTiger

I couldn't upload the saved game file as its beyond allowed limit. Its easily reproducible for me though. Just create a new map in 9.2 with pak Britain-Ex 0.7.1. Create a railway line, electrify it with AC catenary, place an electric depot, place 2 stations, run an electric loco with freight train. Save it and then try to load the game. It crashes with the same error message. I'll try for a smaller map tomorrow.

Thanks.

jamespetts

Thank you for your instructions to reproduce. Unfortunately, however, following those instructions, I cannot reproduce the problem. Can you try uploading a saved game to http://files.simutrans-germany.com?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TheUniqueTiger

Its surprising that the crash that I see from day 1 of playing experimental 9.1 and then 9.2 cannot be reproduced.
Thanks for the suggestion. I have uploaded it there. http://simutrans-germany.com/files/upload/New_4.sve

Hoping for a positive response this time.

jamespetts

Thank you for uploading that. The game does indeed fail to load, and fails in a part related to reloading electrical substations: have you placed any electrical substations in your game? In any event, the immediate cause of the failure is that the saved game is corrupted.

Oddly, however, I cannot reproduce the circumstances that cause the corruption in the first place: I have on numerous occasions successfully saved and re-loaded games including electrical substations.

I am wondering whether it is possible that the difficulty is occasioned by some 32-bit/64-bit incompatibility. I think that, when I get my 64-bit computer built, I might try compiling 64-bit Windows binaries to see whether this assists your problem. It has hitherto been thought that 32-bit binaries work on 64-bit Windows systems without trouble, but the fact that you are able to reproduce regularly a problem that I cannot reproduce at all indicates a possibility that this might not be so. I know that there have been significant difficulties using 32-bit binaries on 64-bit Linux systems (including odd behaviour that cannot be reproduced on my 32-bit machine).

Can anyone else who is running 64-bit Windows confirm whether there have been any similar difficulties?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TheUniqueTiger

Yes, its related to powerlines & electric substations. I did some more research and found that
  • On any map 512*512 or more, it crashes if you have powerlines and electric substations.
  • On any map 384*384 or less, the same kind of powerlines and electric substations work pretty well.
I've been playing Simutrans since 2000, but this is the first map-size related crash I've seen. I hope its solved soon.

For example, I have uploaded 2 saved files, with all default settings...
Can any other member with Win7 x64 please confirm this crash by the given steps... IMO, a program which works properly on 32-bit Windows works without any issues on 64-bit, but not vice-versa.

Thanks.

jamespetts

Hmm, that's very odd. I just created a 768x768 map, added a power station and then a substation next to the power station, power lines to a city and a substation in the city, saved it, and it reloaded without a problem. I have uploaded my saved game here. I should be grateful if you could test it by trying to load it, then re-save it, then re-load it, and let me know what result that you get. Thank you very much!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TheUniqueTiger

#12
Thanks. I hope you tested both my uploaded games whether they load properly.
I downloaded your saved game. It loads fine, and I saved -> loaded again without any problem. I then connected another city with powerline/substation and again saved -> loaded without any problem.
Interestingly now if I create a new 512*512 map and do the same thing as above it doesn't crash. Not sure what's going on at all. I'll have to play more tonight on various maps & situations to confirm again.

EDIT: Still crashes with powerlines & electric substations on a large map.

jamespetts

When you write "large map", how large are you meaning? And in what precise situations do the crashes occur?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TheUniqueTiger

The game is acting really weird. I had sure crashes earlier, but now on a 1024*1024 map, connecting a gas-fired power station to city crashed the game on save -> load. Nothing new. However on another 1024*1024 map with several gas-fired power stations connected to several cities saves -> loads correctly without problems.
By large map I meant maps 512*512 or more as I thought it to be the cause earlier, but not now.

jamespetts

Very odd. It's really very difficult to track these things down without being able to reproduce them; if you get any more information, do let me know.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna

I get this error as well (string longer 38585), and it also seems that it can be predetermined from your save, because the "e 9" version-info will not be recorded in the save list as it should be. However, trying several times to save the save game does nothing, nor does saving it as something else in a new save, so I guess it is some corruption in the actual game rather than just the save, or something about the saving process (autosaves also face the same result). Sometimes the saving works fine under exactly the same circumstances and the same map.

AvG

James,
This happens in my case:
Playing a heightmap UK size 1276*886 starting year 1800 using EXP9.1
I guess I saved and loaded maybe 50 times until gameyear 1804. (All needed Pak-files are made and tested "on the fly")
Now, all of a sudden, I also get the fatal error message when loading the latest save-file. (String longer (5124) than allowed size(128))
Changing to EXP9.2 makes no difference.
AvG
Ad van Gerwen

TheUniqueTiger

Hello James,
I have continued the 'large map' saved game which did not crash. Still no crashes on that one after several saves/loads. However I had a crash on another new map yesterday while save -> load with similar message. So its pretty irregular and unpredictable.
I have downloaded the experimental source code. Can any developer of Simutrans-exp please point me to the specifics of what/where to look for possible error? As it appears its something that the save method saves as string of unknown length, whereas the load method expects the same string to be of limited (128) length. If someone could go through the save/load code for such kind of mismatch, it would be great help.
Thanks.

inkelyad

Look at all rdwr methods.

If you want debug save/load, set 'saveformat' option in simuconf.tab to xml or xml_zipped.
It will make savefiles much bigger, but much more suitable for catching errors.

Spike

I have the slight feeling this might be a result of a dangling pointer or some other sort of memory corruption.

jamespetts

Apologies for not having responded sooner to this discussion: I have been busy lately, partly at work, and partly building a new computer. This seems like a very hard error indeed to track down. Can those who have it try to give some indication of any particular circumstances in which it occurs? Also, can all those who have the issue give a brief outline of your system specifications? Finally, do any of you have the problem in a game saved with 9.2? The problem appears to be in the saving, rather than the loading.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TheUniqueTiger

Hello James,
As I have said earlier, it seemed to be a regular feature with electrification with powerlines/substations, however some maps had crashes while others did not as I found later. It was there for a map created & saved in 9.1 as well as 9.2. I'll go through the same again and look to find out. Till that period if someone tracks down the error, it'll be great. Here are my system specifications:

Intel Core2Duo E7500 @ 2.93GHz, 3GB DDR2 RAM, GigaByte Motherboard G3100, 1.5TB WD Green HDD, Win 7 Ultimate 64-bit

Thanks.

Spike

Quote from: jamespetts on January 13, 2011, 10:37:53 PM
The problem appears to be in the saving, rather than the loading.

I suspect the problem appears before saving. A sort of memory corruption that is not noticed quickly in a running game, but when the data structures are saved, will prevent the loading of that saved (but corrupted) data.

It's just a guess, but comparing these reports to old bug reports from early Simutrans versions, it seems like a likely reason.

TheUniqueTiger

#24
Can you please help me with how to debug? I don't see the console window, neither does the log file give any details other than the fatal error message. I went through the settings in the corrupted saved game file (bzip2 compressed, reading each char after decompressing) and they are correct when compared to another xml saved file. The saved game is quite large after decompression (5MB), hence not feasible to go through the entire thing.
James, how did you find out at first that it crashes while loading electric substations?

Thanks.

EDIT: @ Hajo, after saving the game I continued it for about 30 mins, absolutely normal. Then I closed without saving again. Next time when I tried to load, the game crashed.

prissi

THe fatal error message would be a useful start for debugging such stuff ...

Spike

I guess we must wait and see what James will come up with. My diagnosis is just a guess and might be wrong as well. I'd recommend running the game with Valgrind (a memory debugger) if that is possible. It might help to get a clearer picture about the causes of the problem.

TheUniqueTiger

Quote from: prissi on January 14, 2011, 10:00:00 AM
THe fatal error message would be a useful start for debugging such stuff ...
Hello prissi,
I got the same error message as above (and in the first post) in a newly created 1024*1024 map with connecting powerlines to cities & gas-fired power stations while loading after saving.

FATAL ERROR:
loadsave_t::rdwr_str()
string longer (65535) than
allowed size (128)
PRESS ANY KEY

The same message appears in the log and nothing else which could help debug further.

Is there any method to see the console window which lists step by step debug messages like 'loading cities', 'loading vehicles' etc?

Thanks.

prissi

Sorry, I was thinking you find this during saving.

And hosetly, this rather looks like an error in the code, as aparently a -1 is readed when a string was expected.

TheUniqueTiger

Here's a detailed test done on a map and I was really surprised by the result.

1. Created a new 2048*2048 (as crash is more in large maps), saved it, loaded it, everything good.
2. Created a powerline connecting a gas-fired power station to a city. I remembered the exact locations of the substations & the powerline. Saved it as another file. On loading crashed!
3. Restart Simutrans, load the file created in (1). Loaded well again. Then placed just substations at the same coords in (2), no powerlines. Saved it as another file. On loading continues well.
4. Next continue to build powerlines over the same path as in (2). Now the map is exactly as it was before saving in (2). Saved this time. On loading continues well.

***Recreating the same thing did not crash, which had crashed earlier. I suppose Hajo is correct that something gets corrupted even before saving, sometimes it works normally.

Junna

I've had this problem without building any electricity lines, so I don't think that is the problem.

I was able to play for quite some time, saving many times on a large (2000x2000+) map with thousands of vehicles while using pak.britain (non-ex), but after playing for a while with britain-ex, this happened to the save game in question. Not sure this is indicative of something.

As I said earlier, this error can be seen when a game is saved in the save games list. Normal saves will display the "e 9" version information or similar in the list, but when this corruption occurs, it will not be present. Trying to save again and again does not change anything, so I'd say it's not related to the saving process but, as has been suggested here, a memory corruption.

jamespetts

Can I check - are any of you who have this problem running 32-bit systems?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna


ӔO

okay, I have gotten this too.

using 9.2ex with pak britain 0.7.1
The things that were changed between 190x and 191x 1 and 2 (1 is the autosave from 10 min earlier, 2 is a manual save) were mainly replacement of tracks from WSSR to improved WSSR and replacement of all branch lines to use GWR 2-6-2T.

not much else was changed, from what I can recall.
It was within a 5 or 6 year time frame, since I accidentally saved in 1911 for the 190x save and there wasn't much change in what was available since 1911.

http://dl.dropbox.com/u/17111233/acetate%20190x.sve
http://dl.dropbox.com/u/17111233/acetate%20191x%20bad1.sve
http://dl.dropbox.com/u/17111233/acetate%20191x%20bad2.sve

---------------------------------------------------------------
edit

I think I figured out the problem with my saves. Changing the game settings while running caused it. I only changed the "ground_info" from on to off while playing by using the "i" key, because it was annoying me, and this caused the game saves to corrupt.

The feature where changing game settings through the new map window, and reloading the save to make it take effect was not working, which is why I tried the "i" key method.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

AvG

James,
I just noticed that while saving the program is still running. Checked in Standard. There the program is halted.
Can this cause the load/save problems?
AvG
Ad van Gerwen