Page 1 of 1

[Genhis][2.0.25] Crash deleting big platform with cargo bay (CargoStation::refreshCargoPodCapacity)

Posted: Sat Dec 14, 2024 5:17 pm
by lckd
Deleting big space platform will instantly crash the game. This happened when the surface itself get deleted, so I'm pretty sure it's not caused by standard game UI.

This is long running vanilla space age save (500 hrs) with several big space platform. Whenever I tried to delete my promethium (Chef: Promethium Chunk, 2.8k ton, 40 legendary cargo bay) or big asteroid reprocessing (The Brick, 29.7k ton, 141 legendary cargo bay) platform it will crash. Crash happened when clicking "Delete surface" in editor and normal in-game platform deletion after waiting for 5 mins delay.

Windows 10 Home - 22H2 - 19045.5131
CPU: Ryzen 4800H
RAM: 40 GB

Few observations:
  • Crash is consistently reproducible using method above in my laptop
  • Crash can be avoided by removing stuff on platform manually before deleting platform surface, tested using editor
  • After more testing, it turns out crash can be avoided if cargo bay deleted manually and then delete the surface using editor
I believe there's some issue with cargo bay object destruction which caused memory violation crash.


Code: Select all

 112.534 Error CrashHandler.cpp:503: Exception Code: c0000005, Address: 0x00007ff6ca07d974
ModuleBase: 0x00007ff6c9290000, ImageSize: 02889000, RelativeAddress: 00ded974
 112.534 Error CrashHandler.cpp:509: Access Violation: Read at address 0000000000000020
 112.534 Error CrashHandler.cpp:523: Exception Context:
rax=0000000000000000, rbx=000001bebd9b9220, rcx=000000000000000a,
rdx=0000003a9901c570, rsi=000001bebd9b9ca0, rdi=000001bef73da470,
rip=00007ff6ca07d974, rsp=0000003a9901c570, rbp=0000000000000000,
 r8=000001bef73da490,  r9=000001befb02eec0, r10=0000000000000000,
r11=000001bebd9b9cc0, r12=0000000000000002, r13=000001becd363f30,
r14=0000000000000000, r15=000001bef9d402f0
 112.534 Crashed in D:\SteamLibrary\steamapps\common\Factorio\bin\x64\Factorio.exe (0x00007ff6c9290000 - 0x00007ff6cbb19000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\libraries\StackWalker\StackWalker.cpp(924): StackWalker::ShowCallstack
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Util\Logger.cpp(337): Logger::writeStacktrace
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Util\Logger.cpp(379): Logger::logStacktrace
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Util\CrashHandler.cpp(183): CrashHandler::writeStackTrace
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Util\CrashHandler.cpp(552): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF04FC3E37)
00007FFF04FC3E37 (KERNELBASE): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF07215818)
00007FFF07215818 (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF071FCE46)
00007FFF071FCE46 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF072128BF)
00007FFF072128BF (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF071C2554)
00007FFF071C2554 (ntdll): (filename not available): RtlRaiseException
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF072113CE)
00007FFF072113CE (ntdll): (filename not available): KiUserExceptionDispatcher
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Space\CargoDelivery\CargoStation.cpp(374): CargoStation::refreshCargoPodCapacity
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Space\CargoDelivery\CargoStation.cpp(366): CargoStation::unregisterHatch
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Space\SurfaceCargoLogistics.cpp(136): SurfaceCargoLogistics::unregisterCargoStation
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Entity\Entity.cpp(701): Entity::onDestroy
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Entity\EntityWithOwner.cpp(101): EntityWithOwner::onDestroy
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Entity\SpacePlatformHub.cpp(200): SpacePlatformHub::onDestroy
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Entity\Entity.cpp(319): Entity::forceDestroy
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Surface\Chunk.cpp(936): Chunk::destroyAllEntities
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Map\Map.cpp(2010): Map::deleteSurface
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Map\Map.cpp(1970): Map::processSurfaceDeleteRequests
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Map\Map.cpp(1367): Map::postUpdate
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Scenario\Scenario.cpp(1168): Scenario::postUpdate
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Scenario\Scenario.cpp(1161): Scenario::updateStep
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\MainLoop.cpp(1403): MainLoop::gameUpdateStep
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\MainLoop.cpp(1212): MainLoop::gameUpdateLoop
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\functional(823): std::_Func_impl_no_alloc<`MainLoop::mainLoopStep'::`2'::<lambda_1>,void>::_Do_call
C:\Users\build\AppData\Local\Temp\factorio-build-pI8o6E\src\Util\WorkerThread.cpp(71): WorkerThread::loop
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\thread(56): std::thread::_Invoke<std::tuple<void (__cdecl MapGenerationHelper::*)(void),MapGenerationHelper *>,0,1>
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97): thread_start<unsigned int (__cdecl*)(void *),1>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF06AC7374)
00007FFF06AC7374 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF071BCC91)
00007FFF071BCC91 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
 114.322 Error CrashHandler.cpp:190: Map tick at moment of crash: 109495516
 114.389 Info CrashHandler.cpp:318: Executable CRC: 662702265
 114.389 Error Util.cpp:95: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
 116.403 Uploading log file
 116.424 Error CrashHandler.cpp:270: Heap validation: success.

Re: [2.0.25] Crash deleting big platform with cargo bay (CargoStation::refreshCargoPodCapacity)

Posted: Sat Dec 14, 2024 5:37 pm
by Loewchen
Post the complete log please, see 3638.

Re: [Genhis][2.0.25] Crash deleting big platform with cargo bay (CargoStation::refreshCargoPodCapacity)

Posted: Wed Dec 18, 2024 10:21 am
by Genhis
Thanks for the report, this is fixed for 2.0.27.

Re: [Genhis][2.0.25] Crash deleting big platform with cargo bay (CargoStation::refreshCargoPodCapacity)

Posted: Wed Dec 18, 2024 5:55 pm
by Omnifarious
I so want to know why the specific order in which the cargo platforms are built matters. :-)