Page 1 of 1

[1.1.60] Crash when FluidStream.particle_buffer_size = 0

Posted: Tue Jun 14, 2022 10:54 am
by moon69
Setting FluidStream.particle_buffer_size = 0 causes a crash when trying to surface.create_entity() the stream.

Code: Select all

26.252 Error CrashHandler.cpp:494: Exception Code: c0000005, Address: 0x00007ff7d0a7e461
ModuleBase: 0x00007ff7d0770000, ImageSize: 01dc2000, RelativeAddress: 0030e461
  26.252 Error CrashHandler.cpp:500: Access Violation: Write at address 0000000000000000
  26.252 Error CrashHandler.cpp:514: Exception Context:
rax=00000000057c7ff0, rbx=ffffff80fffffd80, rcx=00000000000f6366,
rdx=00000000057c7ff0, rsi=0000019d14e5b620, rdi=0000000000000000,
rip=00007ff7d0a7e461, rsp=0000003eedef99a0, rbp=0000000000000000,
 r8=0000000044d1eeba,  r9=0000019cfdecbb9c, r10=000000002cf9e91a,
r11=0000003eedef9b20, r12=00000000ffffff80, r13=0000019cfdecbb9c,
r14=0000000000000000, r15=0000019c8be22d30
  26.252 Crashed in C:\Factorio\bin\x64\factorio.exe (0x00007ff7d0770000 - 0x00007ff7d2532000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\logger.cpp (316): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\logger.cpp (323): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\crashhandler.cpp (186): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\crashhandler.cpp (543): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF89FA2FF27)
00007FF89FA2FF27 (KERNELBASE): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1E151B0)
00007FF8A1E151B0 (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1DFC766)
00007FF8A1DFC766 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1E1209F)
00007FF8A1E1209F (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1DC1454)
00007FF8A1DC1454 (ntdll): (filename not available): RtlRaiseException
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1E10BCE)
00007FF8A1E10BCE (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-build-2lzouv\src\entity\fluidstream.cpp (418): FluidStream::generateParticle
c:\cygwin64\tmp\factorio-build-2lzouv\src\entity\fluidstream.cpp (61): FluidStream::FluidStream
c:\cygwin64\tmp\factorio-build-2lzouv\src\entity\fluidstreamprototype.cpp (136): FluidStreamPrototype::createInternal
c:\cygwin64\tmp\factorio-build-2lzouv\src\entity\entityprototype.cpp (694): EntityPrototype::create
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\luahelper.cpp (3605): LuaHelper::createEntity
c:\cygwin64\tmp\factorio-build-2lzouv\src\script\luasurface.cpp (1740): LuaSurface::luaCreateEntity
c:\cygwin64\tmp\factorio-build-2lzouv\src\script\luabinder.hpp (348): LuaBinder<LuaPlayer>::callWrapperOnObject
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\ldo.c (350): luaD_precall
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\lvm.c (713): luaV_execute
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\lapi.c (1067): f_call
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\ldo.c (137): luaD_rawrunprotected
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\ldo.c (623): luaD_pcall
c:\cygwin64\tmp\factorio-build-2lzouv\libraries\lua\lapi.c (1093): lua_pcallk
c:\cygwin64\tmp\factorio-build-2lzouv\src\util\luahelper.cpp (4212): LuaHelper::pCallWithStackTrace
c:\cygwin64\tmp\factorio-build-2lzouv\src\script\luagamescript.cpp (1111): LuaGameScript::runEventHandler
c:\cygwin64\tmp\factorio-build-2lzouv\src\script\luaeventdispatcher.cpp (668): LuaEventDispatcher::run
c:\cygwin64\tmp\factorio-build-2lzouv\src\script\luaeventdispatcher.cpp (494): LuaEventDispatcher::dispatch
c:\cygwin64\tmp\factorio-build-2lzouv\src\gameactiondispatcher.cpp (14): GameActionDispatcher::sendToListeners
c:\cygwin64\tmp\factorio-build-2lzouv\src\gameactionhandler.cpp (3515): GameActionHandler::reverseSelectArea
c:\cygwin64\tmp\factorio-build-2lzouv\src\gameactionhandler.cpp (368): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-build-2lzouv\src\input\inputhandler.cpp (61): InputHandler::flushActions
c:\cygwin64\tmp\factorio-build-2lzouv\src\gameactionhandler.cpp (411): GameActionHandler::update
c:\cygwin64\tmp\factorio-build-2lzouv\src\mainloop.cpp (1245): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-2lzouv\src\mainloop.cpp (1108): MainLoop::gameUpdateLoop
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\functional (15732480): std::_Func_impl_no_alloc<<lambda_11d3bb4442d624cc5c3d3e4f19b974dd>,void>::_Do_call
c:\cygwin64\tmp\factorio-build-2lzouv\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 RouterBase::*)(void),ClientRouter *>,std::default_delete<std::tuple<void (__cdecl RouterBase::*)(void),ClientRouter *> > > >::_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: 00007FF89FFE7034)
00007FF89FFE7034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF8A1DC2651)
00007FF8A1DC2651 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  27.948 Error CrashHandler.cpp:191: Map tick at moment of crash: 52821
  27.988 Info CrashHandler.cpp:311: Executable CRC: 2233138942

Re: [1.1.60] Crash when FluidStream.particle_buffer_size = 0

Posted: Tue Jun 14, 2022 5:16 pm
by Rseding91
Thanks for the report. I added a check for this for the next release. A fluid stream with no particle support makes no sense because it will just kill itself the first time it updates.

Re: [1.1.60] Crash when FluidStream.particle_buffer_size = 0

Posted: Tue Jun 14, 2022 6:10 pm
by moon69
Thanks.

Agreed - I was just trial & erroring since the docs on what the various properties do are a quite... streamlined :)