Page 1 of 1

[2.0.57] Crash when trying to clone rolling stock

Posted: Sat Jul 12, 2025 2:30 pm
by Natha
Trief this in my mod:

Code: Select all

local e = carriage.clone{position = teleport_pos, surface = v.surface, force = carriage.force}
The carriage is moving.

The game crashed with the following message:

Code: Select all

C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\Util\ReleaseAssert.cpp(7): ReleaseAssertFailed
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\Entity\RollingStock.cpp(1431): RollingStock::checkConsistency
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\Map\ConsistencyScraper.cpp(41): ConsistencyScraper::step
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\Game.cpp(175): Game::update
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\Scenario\Scenario.cpp(1130): Scenario::updateStep
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\MainLoop.cpp(1478): MainLoop::gameUpdateStep
C:\Users\build\AppData\Local\Temp\factorio-build-CUjDhu\src\MainLoop.cpp(1273): 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-CUjDhu\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 WorkerThread::*)(void),WorkerThread *>,0,1>
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97): thread_start<unsigned int (__cdecl*)(void *),1>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB98607374)
00007FFB98607374 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB98F9CC91)
00007FFB98F9CC91 (ntdll): (filename not available): RtlUserThreadStart

Re: [2.0.57] Crash when trying to clone rolling stock

Posted: Mon Jul 14, 2025 4:22 pm
by Rseding91
Thanks for the report. I'm trying to reproduce the crash however I haven't been successful. Do you have any kind of minimal reproduction?

Re: [2.0.57] Crash when trying to clone rolling stock

Posted: Sun Jul 20, 2025 2:26 pm
by Natha
Actually I cannot reproduce it outside of my mod.
Creating the carriage via create_entity on the same position works fine, with clone it crashes. But when I output some "breakpoint messages" after this line to a file, it shows that the code runs through the end of the tick loop (variable e is [LuaEntity: locomotive at [gps=143.0,5.4,nauvis_subsurface_1]]).

The corresponding code is https://github.com/NathaU/factorio-subs ... trains.lua line 117

My suggestion would be that cloned rolling stocks behaves differently than that from create_entity?

Could you give me a hint what RollingStock::checkConsistency and ReleaseAssert do?

Re: [2.0.57] Crash when trying to clone rolling stock

Posted: Sun Jul 20, 2025 2:59 pm
by Rseding91
It’s checking that the speed is 0 or the doors are closing. It’s never supposed to have the doors in the opening state when moving.