Page 1 of 1

[posila] [1.0.0] Crash modding capsule with warmup

Posted: Sat Oct 31, 2020 6:05 pm
by PFQNiet
As far as I can tell this should be as simple to reproduce as:

Code: Select all

data.raw.capsule['raw-fish'].capsule_action.attack_parameters.warmup = 30
Then, attempting to use a fish causes the game to crash. Extract from the log:
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-jhy8mv\src\trigger\shooter.cpp (844): Shooter::updateNoDelayedShoot
c:\cygwin64\tmp\factorio-build-jhy8mv\src\entity\character.cpp (699): Character::update
c:\cygwin64\tmp\factorio-build-jhy8mv\src\surface\chunk.cpp (611): Chunk::updateActiveEntities
c:\cygwin64\tmp\factorio-build-jhy8mv\src\surface\chunk.cpp (672): Chunk::updateEntities
c:\cygwin64\tmp\factorio-build-jhy8mv\src\surface\surface.cpp (1610): Surface::update
c:\cygwin64\tmp\factorio-build-jhy8mv\src\map\map.cpp (1667): Map::updateEntities
c:\cygwin64\tmp\factorio-build-jhy8mv\src\game.cpp (207): Game::update
c:\cygwin64\tmp\factorio-build-jhy8mv\src\scenario\scenario.cpp (1219): Scenario::update
c:\cygwin64\tmp\factorio-build-jhy8mv\src\mainloop.cpp (1175): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-jhy8mv\src\mainloop.cpp (1042): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-build-jhy8mv\src\util\workerthread.cpp (49): WorkerThread::loop
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*)(ParallelDesyncReportCreator *),ParallelDesyncReportCreator *>,std::default_delete<std::tuple<void (__cdecl*)(ParallelDesyncReportCreator *),ParallelDesyncReportCreator *> > > >::_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: 00007FF9E2687BD4)
00007FF9E2687BD4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF9E43ECE51)
00007FF9E43ECE51 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
53.327 Error Shooter.cpp:844: Shooter doesn't support delayed shooting.
Seems fairly straightforward, there's even a clear error message: "Shooter doesn't support delayed shooting."

I imagine this is the kind of thing that should be caught and handled gracefully with the "a mod caused an error" popup, not a full game crash!

Re: [1.0.0] Crash modding capsule with warmup

Posted: Mon Nov 02, 2020 7:44 am
by posila
Thanks for the report.
"a mod caused an error" can happen only if there is unhandled error in control script. This is invalid prototype configuration, so if possible, it should be validated on prototype load.

Added validation that attack_parameters in capsule_action has 0 warmup for 1.1