[2.0.14] Corrupted Save(s) while debugging.

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Olipro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat May 28, 2016 1:28 am
Contact:

[2.0.14] Corrupted Save(s) while debugging.

Post by Olipro »

I have a save file I use for testing things in the game and somehow, it (and all autosaves taken within the last half hour) have managed to become corrupted with an error that says "Invalid bool loaded from input file. File could be corrupted"

This save does use a singular mod (Lua API global variable viewer) that lets me inspect lua objects but I wouldn't have thought it should be possible for it to cause save file corruption. I have not been altering the lua state during my playthrough, just inspecting objects I need to pull data from.

The save is attached.

Edit: some relevant lines that I found in the log, though you'll probably see them yourselves

475.343 Info Scenario.cpp:178: Map version 2.0.14-2
475.570 Warning Map.cpp:358: Map loading failed: Invalid bool loaded from input file. File could be corrupted.
476.124 Error AppManagerStates.cpp:1655: Invalid bool loaded from input file. File could be corrupted.
Attachments
Debug Testing.zip
(48.77 MiB) Downloaded 12 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

Thanks for the report however the map file is already corrupt. Do you have the non-corrupt version I can use and steps to get it into the corrupt state?
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

Looking at the save, there is exactly 1 byte that is corrupt which when fixed allows the save to be loaded. That has historically always meant failing hardware on the players computer. Most commonly bad RAM. I recommend running a memory test https://www.memtest.org/
If you want to get ahold of me I'm almost always on Discord.
Olipro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat May 28, 2016 1:28 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Olipro »

I booted a bootable memtest86 and had no issues. All the autosaves are also corrupted and were taken 5 minutes apart. I can upload them if you like but I'm pretty suspicious about blaming this one on hardware... unless the space station that's currently nuking the hell out of asteroids managed to rowhammer the memory (though if it flipped an entire byte and not a bit, that's unlikely), but that particular peculiarity is a universal vulnerability of all RAM.

For my own reference, can you give me the filename and offset I need to hexedit to make it functional again?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

I don't know the offset sorry. It's on the character logistic point - the boolean that says if it requests from buffers or not. The save file is split into multiple chunks compressed in RAM and written into the zip.

It's possible there's some base game bug that corrupted it. But so far nobody has found any steps to take a known good save and get it into a broken state.
If you want to get ahold of me I'm almost always on Discord.
Olipro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat May 28, 2016 1:28 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Olipro »

Alright, if I'm SOL then I'm SOL. If you can provide me with like ~20 bytes, even just a screenshot, maybe I can extract the zip, search the sequence from all the files in there and patch it.

No expectations but I'd sure appreciate it.
gansgut
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Nov 07, 2024 8:32 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by gansgut »

[2.0.14] Space age
I have same issue in same environment. I created dev world made for blueprints with activated /cheat and /editor a couple days ago. Today i get error dedicated to this world. Save and autosaves don't load with error "Invalid bool loaded from input file. File could be corrupted". Other saves work normally.

No mods
Memtest64 4 passes, no errors.

https://drive.google.com/file/d/1l5at2v ... share_link

Strings from log file:
39.749 Warning Map.cpp:358: Map loading failed: Invalid bool loaded from input file. File could be corrupted.
40.129 Error AppManagerStates.cpp:1655: Invalid bool loaded from input file. File could be corrupted.
42.431 Loading map C:\Users\konstantin\AppData\Roaming\Factorio\saves\_autosave2.zip: 60780484 bytes.
42.458 Loading level.dat: 159422493 bytes.
42.462 Info Scenario.cpp:178: Map version 2.0.14-2
43.738 Error RuntimeError.cpp:24: Invalid bool loaded from input file. File could be corrupted.
Factorio crashed. Generating symbolized stacktrace, please wait ...
Attachments
factorio-current.log
(34.94 KiB) Downloaded 10 times
Last edited by gansgut on Thu Nov 07, 2024 9:16 am, edited 2 times in total.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

Actually, someone found a reproduction for this here viewtopic.php?f=30&t=120101 In a rare first, "invalid bool loaded from input file" was an engine bug! So this issue is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

The fixed file. Although it will keep getting broken until the fixed version is released. The trigger to break it is: change the force of a character entity from one that does not have logistics unlocked to one that does.
Attachments
Debug Testing fixed.zip
(48.35 MiB) Downloaded 13 times
If you want to get ahold of me I'm almost always on Discord.
Olipro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sat May 28, 2016 1:28 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Olipro »

Good to hear, as a C++ dev myself, my first thought was that it'd be a race condition, turns out it's simpler than that! Glad you found it.

Many thanks for the fixed save!
gansgut
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Nov 07, 2024 8:32 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by gansgut »

Actually, someone found a reproduction for this here viewtopic.php?f=30&t=120101 In a rare first, "invalid bool loaded from input file" was an engine bug! So this issue is now fixed for the next release.

Thank you for fast reaction! Please fix my save too)

Or how can i fix it by myself?
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 531
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Silari »

gansgut wrote: Fri Nov 08, 2024 2:58 pm
Actually, someone found a reproduction for this here viewtopic.php?f=30&t=120101 In a rare first, "invalid bool loaded from input file" was an engine bug! So this issue is now fixed for the next release.

Thank you for fast reaction! Please fix my save too)

Or how can i fix it by myself?
From the looks of it it should be fixed automatically if you load it into 2.0.16 which was just released a few minutes ago. The linked report is listed in the changelog. That versions currently experimental so you'd need to opt into the experimental branch of the game if you haven't yet.
gansgut
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Nov 07, 2024 8:32 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by gansgut »

Silari wrote: Fri Nov 08, 2024 3:42 pm
gansgut wrote: Fri Nov 08, 2024 2:58 pm
Actually, someone found a reproduction for this here viewtopic.php?f=30&t=120101 In a rare first, "invalid bool loaded from input file" was an engine bug! So this issue is now fixed for the next release.

Thank you for fast reaction! Please fix my save too)

Or how can i fix it by myself?
From the looks of it it should be fixed automatically if you load it into 2.0.16 which was just released a few minutes ago. The linked report is listed in the changelog. That versions currently experimental so you'd need to opt into the experimental branch of the game if you haven't yet.
[2.0.16] experimental

I just uploaded latest beta. In right left corner of the screen i have sign ''2.0.16 (build 80214 expansion, win64)".
Corrupted save doesn't load with same error "Invalid bool loaded from input file. File could be corrupted".

So save wasn't fixed automatically. Or i did something wrong. What can i do next?
farazsth98
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2024 11:29 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by farazsth98 »

Hey Rseding91,

I'm curious, what tool are you using to inspect the save file data? You said it's compressed into the save, so I'm wondering if there is a way to uncompress the data so I can look at it myself?

Thanks!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by Rseding91 »

I use the game itself while visual studio's debugger is attached.
If you want to get ahold of me I'm almost always on Discord.
farazsth98
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Oct 26, 2024 11:29 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by farazsth98 »

Ah right of course haha that makes sense! I just noticed the Factorio PDB is provided right with the executable in the installation directory, so that's nice!

There's a few other instances of this crash in 2.0.16, and they all end up with a stack trace that ends up failing deserialisation through `LogisticsPointFilter::load()`. I haven't personally ran into it but I was trying to see if I could modify whatever byte offset of the save file in order to fix the save file for someone else.

Will try run with a debugger myself and see if I can narrow down what's going on.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 304
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by BraveCaperCat »

Shouldn't this be moved to "Fixed Bugs"?
Creator of multiple mods, including Quality Assurance - My most popular one. Expect multiple modding-related questions, answers and other posts.
gansgut
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Nov 07, 2024 8:32 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by gansgut »

Corrupted saves doesn't fix automatically.
Silari wrote: Fri Nov 08, 2024 3:42 pm From the looks of it it should be fixed automatically if you load it into 2.0.16 which was just released a few minutes ago. The linked report is listed in the changelog. That versions currently experimental so you'd need to opt into the experimental branch of the game if you haven't yet.
Players still meet this bug also in 2.0.16. Here is latest discussion viewtopic.php?f=7&t=120318&p=637117&hilit=bool#p637117.
BraveCaperCat wrote: Mon Nov 11, 2024 10:10 am Shouldn't this be moved to "Fixed Bugs"?
Why this bug should be moved to fixed ones?
DomNomNom
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Apr 11, 2020 11:48 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by DomNomNom »

@olipro: I've recovered your ship design and attached it as a blueprint string.

Also this is ridiculous lol:
11-12-2024, 01-54-13.png
11-12-2024, 01-54-13.png (5.04 MiB) Viewed 338 times
Attachments
olipro_ship.txt
(22.3 KiB) Downloaded 11 times
DomNomNom
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat Apr 11, 2020 11:48 am
Contact:

Re: [2.0.14] Corrupted Save(s) while debugging.

Post by DomNomNom »

@gansgut - here's your save file that I've fixed in the same way I've fixed mine: https://factorio.domnomnom.com/2024-game-test-2 fixed.zip

How I fixed mine: viewtopic.php?p=637305#p637305
Post Reply

Return to “1 / 0 magic”