Defect preview.png in savefile closes game on preview

Bugs that are actually features.
Pizzagod
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 17, 2016 8:39 pm
Contact:

Defect preview.png in savefile closes game on preview

Post by Pizzagod »

I run Factorio on two setups, one is a FreeBSD computer with wine and steam, the other uses Archlinux with native Steam and factorio. I use the steam cloud sharing to synchronize the savegames between both computers. Whenever I attempt to access the loading menu in Linux (as in where you can see all the savegames), the game crashes with the following output:

Code: Select all

[...]
  30.692 Factorio initialised
  30.692 Game is running on selected version branch on Steam.
  35.119 Error Util.cpp:57: Sprite "/<path to savegame>/preview.png" couldn't be loaded
  35.278 Steam API shutdown.
  35.281 Goodbye
The rest of the logfile looks fine. The same thing happens whenever I try to save manually (basically everywhere where you can see the previews of your saves).

This happens with all the savegames (it crashes on the first one, removing it makes it happen with the next one). I can play, load and save fine on both computers, I just can't seem to access my FreeBSD saves on the other one. This has been happening with at least 0.13.14 (I did not test earlier, but I assume it happened with earlier versions as well) and still happens with 0.13.16. This happens even with all mods disabled (though the savegames make heavy use of mods).

I can unzip the faulty savegame manually, the preview.png is 0 Bytes in size in all savegames (that is the savegames originating on FreeBSD when accessing them on Linux). I assume that this is where the error stems from. This means you should be able to reproduce the problem by removing a preview.png and then simply touching it, then attempt to load the save. Replacing all faulty preview.png files with previews taken from other saves (generated on Linux) allows me to open the menu and load savegames. However this is a work around at best.

Since factorio zips the savegames, I doubt that the steam cloud swallows the previews. The previews definitively exist on FreeBSD (I see them when opening the loading menu), although I can currently not determinate if they are also present in the zip files themselves.

I do not know if this is because I'm sharing the savegames between the Linux and the Windows version of factorio or because FreeBSD/Wine does something wrong. Either way it points to some sort of bug. Additionally, it would be cool if factorio would default to a fallback preview if a preview isn't available instead of just crashing.
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by TruePikachu »

Do other applications on the FreeBSD machine (under Wine) generate valid .png files? My Windows install has been generating them correctly, and they are present (and valid) in saved games.
Pizzagod
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 17, 2016 8:39 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by Pizzagod »

I will be able to test this on the weekend since I don't have access to the computer at the moment. However, I can see the previews when loading games on FreeBSD, so they have to exist in some format that is bigger than 0 Bytes in size.
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by TruePikachu »

Could you upload an example of a problematic savegame?
Loewchen
Global Moderator
Global Moderator
Posts: 9257
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by Loewchen »

If opening the FreeBSD archives from the linux machine manually already shows damaged/incomplete files then this is obviously not a fault on the application side.
A fall back preview would strictly be a feature request but I will wait for a dev statement.
Pizzagod
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 17, 2016 8:39 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by Pizzagod »

I'm sorry I can't provide a savegame since upload speed is rather slow. However, you can take any savegame, unzip it and replace the preview.png file with an empty file to produce a faulty savegame.

Not being able to load a faulty savegame isn't a bug, but creating faulty savegames certainly is. I don't know at which point the savegame gets corrupted, but it's definitively worth looking into.
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: Corrupted savegame via empty preview.png

Post by TruePikachu »

Pizzagod wrote:I'm sorry I can't provide a savegame since upload speed is rather slow. However, you can take any savegame, unzip it and replace the preview.png file with an empty file to produce a faulty savegame.
I'm rather interested in seeing if there is some weird filesystem-related issue in the file itself. Diagnosing the issue with FreeBSD+Wine, rather than the overall issue with Factorio. As you said, FreeBSD can see the previews.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Defect preview.png in savefile closes game on preview

Post by Oxyd »

Neither FreeBSD nor Wine is supported. Furthermore, since you can see the preview on FreeBSD, it means it's probably saved correctly. You say that it then magically disappears sometime during the move from FreeBSD to Linux, which suggests that there's a problem outside of Factorio.

Moving to Not a Bug. If you can find a reproducible case where the game creates an invalid preview image on a supported platform (that is, neither FreeBSD nor Wine), we'll take a look at it.
Pizzagod
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Aug 17, 2016 8:39 pm
Contact:

Re: Defect preview.png in savefile closes game on preview

Post by Pizzagod »

Turns out I was wrong and the FreeBSD saves are also lacking the preview, however, attempting to load them on FreeBSD doesn't crash the game, the preview is simply missing.
Post Reply

Return to “Not a bug”