Page 1 of 1

[0.18.4] Crash loading map after removing fluid recipes with indexes: "Fluid not compatible with this fluidbox's filter"

Posted: Sat Feb 08, 2020 11:48 am
by GotLag
I have a mod, MMOTO, which adds mirrored versions of oil processing and chemistry recipes. MMOTO modifies the base game oil and chemistry recipes, by finding all recipes with 2 or more fluid inputs, and explicitly setting the fluidbox_index on each input. It does the same with outputs. It then creates copies of these recipes and flips them by modifying the fluidbox_index values, rather than by reordering the ingredients/results in the recipe prototype tables as GDIW did.

I have a save game using the mirrored-output version of the advanced oil processing recipe in several refineries.
If have found that if I remove MMOTO and attempt to load the save, it crashes.

From what I can see it looks like the fluid consistency checker might not be successfully handling the case of removed recipes where the fluid_index values were used to change the order of ingredients/results from that of the order the ingredients/results were listed in the recipe prototype table.

Crash log
Vanilla Nice.zip
Save file which crashes
(7.92 MiB) Downloaded 174 times

Re: [0.18.4] Crash when loading map after removing fluid recipes with indexes

Posted: Sat Feb 08, 2020 4:30 pm
by TruePikachu

Code: Select all

Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-tkfejd\src\fluid\fluidbox.cpp (588): FluidBox::checkConsistency
c:\cygwin64\tmp\factorio-build-tkfejd\src\map\map.cpp (2211): Map::checkConsistency
c:\cygwin64\tmp\factorio-build-tkfejd\src\map\map.cpp (1252): Map::setupEntities
c:\cygwin64\tmp\factorio-build-tkfejd\src\scenario\scenario.cpp (307): Scenario::loadFactory
c:\cygwin64\tmp\factorio-build-tkfejd\src\scenario\parallelscenarioloader.cpp (151): ParallelScenarioLoader::doLoad
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\thr\xthread (230): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl*)(ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *),ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *>,std::default_delete<std::tuple<void (__cdecl*)(ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *),ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\thr\xthread (209): std::_Pad::_Call_func
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFD71DF7BD4)
00007FFD71DF7BD4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFD73C4CED1)
00007FFD73C4CED1 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  28.184 Error FluidBox.cpp:588: Fluid not compatible with this fluidbox's filter

Re: [0.18.4] Crash loading map after removing fluid recipes with indexes: "Fluid not compatible with this fluidbox's fil

Posted: Sun Feb 09, 2020 1:04 pm
by GotLag
Here's a better demonstration map:
Fluid Crash Demo.zip
(1.57 MiB) Downloaded 155 times
Here's a modified version of MMOTO that successfully loads without crashing:
MMOTO_1.0.1.zip
(55.04 KiB) Downloaded 148 times

The refinery is using the recipe advanced-oil-processing-mmoto-both
The chemical plant is using heavy-oil-cracking-mmoto-in

The zip of MMOTO 1.0.1 above has been modified from 1.0.0 to change the recipe naming scheme from -mmoto- to -mirrored-
The JSON migration contains two lines, migrating the mmoto-named recipes to mirrored-named versions. Note that the recipes not being actively used at the time of the save don't need to be migrated for the game to load, but if either of the recipes in that migration are removed, it will crash.

Re: [0.18.4] Crash loading map after removing fluid recipes with indexes: "Fluid not compatible with this fluidbox's fil

Posted: Mon Mar 02, 2020 5:57 pm
by posila
Thanks for the report.
Fixed for 0.18.10