Infinte loop causing game freeze

This subforum contains all the issues which we already resolved.
Post Reply
Programmdude
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri May 02, 2014 2:46 pm
Contact:

Infinte loop causing game freeze

Post by Programmdude »

This has only happened since 0.12, it has happened in multiplayer and singleplayer. When playing multiplayer the other clients crashed, while I (the server) just froze. When this happened in singleplayer I jumped into the debugger to see if I could help find the cause.
The renderer thread is still running, so windows doesn't display a "program not responding" dialog, the freeze appears to be related to multithreading, since it is waiting on a mutex. Attempting to do step out while in the debugger simply resumes the game, so WaitForMultipleObjectsEx never completes.
The update thread appears to be stuck in TransportBelt::update.

This is the call stack for the main thread:
ntdll.dll!NtWaitForMultipleObjects()
KernelBase.dll!WaitForMultipleObjectsEx()
Factorio.exe!boost::this_thread::interruptible_wait(void *,struct boost::detail::timeout)
Factorio.exe!boost::detail::basic_condition_variable::do_wait<boost::unique_lock<boost::mutex> >(boost::unique_lock<boost::mutex> & lock, boost::detail::timeout abs_time) Line 227
Factorio.exe!ThreadBarrier::wait() Line 34
Factorio.exe!MainLoop::tickStep(Thread & updateThread, ThreadBarrier & barrier, boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > & nextFramePoint, boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > & lastMultiplayerUpdate, bool & haveMultiplayer) Line 481
Factorio.exe!MainLoop::run(const boost::filesystem::path & execPath, const boost::filesystem::path & configPath, bool autoupdateFinished, bool headlessMode) Line 531
Factorio.exe!wmain(int argc, wchar_t * * argv) Line 347
Factorio.exe!__tmainCRTStartup() Line 255
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

And the call stack for the update thread:
Factorio.exe!TransportBelt::update() Line 195 C++
Factorio.exe!Chunk::update(unsigned int tick, Surface & surface) Line 438 C++
Factorio.exe!Surface::update() Line 733 C++
Factorio.exe!Map::update() Line 897 C++
Factorio.exe!Game::update() Line 135 C++
Factorio.exe!Scenario::update() Line 736 C++
Factorio.exe!MainLoop::gameUpdateStep(MultiplayerManager * multiplayerManager, Scenario * scenario, AppManager * appManager) Line 250 C++
Factorio.exe!MainLoop::updateLoop(ThreadBarrier * barrier, boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * nextFramePoint, boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * lastMultiplayerUpdate, bool * haveMultiplayer, bool tryAlignToVsync) Line 351 C++
Factorio.exe!boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void,void (__cdecl*)(ThreadBarrier * __ptr64,boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * __ptr64,boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * __ptr64,bool * __ptr64,bool),boost::_bi::list5<boost::_bi::value<ThreadBarrier * __ptr64>,boost::_bi::value<boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * __ptr64>,boost::_bi::value<boost::chrono::time_point<boost::chrono::steady_clock,boost::chrono::duration<__int64,boost::ratio<1,1000000000> > > * __ptr64>,boost::_bi::value<bool * __ptr64>,boost::_bi::value<bool> > >,void>::invoke(boost::detail::function::function_buffer & function_obj_ptr) Line 160 C++
Factorio.exe!Thread::loop() Line 34 C++
Factorio.exe!boost::`anonymous namespace'::thread_start_function(void *) C++
Factorio.exe!_callthreadstartex() Line 376 C
Factorio.exe!_threadstartex(void * ptd) Line 354 C
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown

The log file doesn't have much of use, but these are the platform details it gets. I am also running windows 8.1 x64, with the x64 version of the game.
0.000 2015-07-20 00:59:17; Factorio 0.12.0 (Build 103, win64)
0.001 Operating system: Windows 8
0.001 Read data path: C:/Games/Factorio_12/data
0.001 Write data path: C:/Users/Programmdude/AppData/Roaming/Factorio
0.001 Binaries path: C:/Games/Factorio_12/bin
0.209 Initialised Direct3D: AMD Radeon HD 6900 Series; driver: aticfx64.dll 8.17.10.1333
0.234 Graphics options: [FullScreen: true] [VSync: true] [UIScale: 100%] [MultiSampling: X 8] [Graphics quality: normal] [Video memory usage: all]

EDIT: I saved a minidump, this forum doesn't allow uploading .dmp files, so I have uploaded it to dropbox.
https://www.dropbox.com/s/c2k8ou46ysnv3 ... i.dmp?dl=0
Stepping through the debugger, the line number of TransportBelt::Update goes from 192 to 195, so whatever is causing the looping is in that region.

EDIT 2: I think it's the same issue as this post: https://forums.factorio.com/forum/vie ... =7&t=13616

Rseding91
Factorio Staff
Factorio Staff
Posts: 13239
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Infinte loop causing game freeze

Post by Rseding91 »

Can you post the save file? Does it happen every time on the save?

Edit: I fixed the issue in the linked report. If you have a save I can make sure your issue was the same problem.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”