Page 1 of 1

[kovarex] [0.16.49]Item stack needs an item and doesn't have one

Posted: Sun Jun 10, 2018 2:25 pm
by Bilka
Crash directly after joining a multiplayer map, at the start of catching up. Log and dump attached, mods used are: https://mods.factorio.com/mod/creative-mode-fix and https://mods.factorio.com/mod/Blueprint_Flip_Turn

Can reproduce by joining the same game again. A workaround would be nice :P

Code: Select all

c:\cygwin64\tmp\factorio-build-irdwpg\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-irdwpg\src\util\logger.cpp (408): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-irdwpg\src\util\logger.cpp (521): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-irdwpg\src\util\logging.cpp (89): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-build-irdwpg\src\item\itemstack.cpp (104): ItemStack::save
c:\cygwin64\tmp\factorio-build-irdwpg\src\item\inventory.cpp (437): Inventory::save
c:\cygwin64\tmp\factorio-build-irdwpg\src\item\inventorywithfilters.cpp (70): InventoryWithFilters::save
c:\cygwin64\tmp\factorio-build-irdwpg\src\entity\character.cpp (962): Character::save
c:\cygwin64\tmp\factorio-build-irdwpg\src\map\heuristiccrcgenerator.cpp (57): HeuristicCrcGenerator::saveMap
c:\cygwin64\tmp\factorio-build-irdwpg\src\map\heuristiccrcgenerator.cpp (27): HeuristicCrcGenerator::get
c:\cygwin64\tmp\factorio-build-irdwpg\src\scenario\scenario.cpp (987): Scenario::updateCrcCheck
c:\cygwin64\tmp\factorio-build-irdwpg\src\scenario\scenario.cpp (880): Scenario::update
c:\cygwin64\tmp\factorio-build-irdwpg\src\mainloop.cpp (1007): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-irdwpg\src\mainloop.cpp (874): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-build-irdwpg\src\util\workerthread.cpp (36): WorkerThread::loop
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.12.25827\include\thr\xthread (232): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl WorkerThread::*)(void) __ptr64,WorkerThread * __ptr64>,std::default_delete<std::tuple<void (__cdecl WorkerThread::*)(void) __ptr64,WorkerThread * __ptr64> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.12.25827\include\thr\xthread (211): std::_Pad::_Call_func
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFFD6291FE4)
00007FFFD6291FE4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFFD8E1F061)
00007FFFD8E1F061 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
 569.876 Error ItemStack.cpp:104: Item stack needs an item and doesn't have one while saving: pointer: 0x00000235c6acaad8, item pointer: (nil), ID: 316, count: 50, stack size: 50, prototype stack size: 1, prototype type: selection-tool
Logger::writeStacktrace skipped.

Re: [0.16.49]Item stack needs an item and doesn't have one

Posted: Sun Jun 10, 2018 2:28 pm
by AntiElitz
Savegame:

Re: [0.16.49]Item stack needs an item and doesn't have one

Posted: Sun Jun 10, 2018 2:32 pm
by Bilka
I can load the savegame normally. Workaround for mp is removing the magic wand from anti's inventory (put into chest and shot it).

Re: [kovarex] [0.16.49]Item stack needs an item and doesn't have one

Posted: Mon Jun 11, 2018 10:31 am
by kovarex
Well, the fact that ItemStack with prototype stack size 1 got 50 count and 50 stackSize is already very weird, the fact that it didn't have item pointer when it should be is just adding to it.
The problem is, that I can't really see how this could happen and I can't reproduce it.
Are there any more hints?

Re: [kovarex] [0.16.49]Item stack needs an item and doesn't have one

Posted: Mon Jun 11, 2018 10:45 am
by Bilka
kovarex wrote:Well, the fact that ItemStack with prototype stack size 1 got 50 count and 50 stackSize is already very weird, the fact that it didn't have item pointer when it should be is just adding to it.
The problem is, that I can't really see how this could happen and I can't reproduce it.
Are there any more hints?
We have no idea how this came to be. One additional note would be that after I joined, after Anti removed the wand from his inventory, another person tried to join, but couldn't (same stacktrace despite the wand being gone). We also tried rehosting the save, since Anti could obviously save, which also didn't help. Perhaps you could try hosting the save and joining via the public game list, maybe that will crash. NOTE: You will probably need to have creative mode enabled.

We ended up taking a blueprint of the setup and continuing in another save, where everyone (about 7 people) could join and leave without problem.

Edit: I can reproduce weirdness when joining the posted save via LAN... desync on join, crash while downloading the desync report.

Re: [kovarex] [0.16.49]Item stack needs an item and doesn't have one

Posted: Sun Jun 17, 2018 1:44 pm
by Rseding91
Thanks for the report it's now fixed for 0.17.

The issue comes from the custom scenario the save is using.