Page 1 of 1

Factorio crashed when exploring the edge of the map

Posted: Sun Jul 24, 2022 8:33 pm
by billbo99
So playing Space Exploration 0.6 and exploring how far I could go on an asteroid belt I found I could go past the 1m marker. Got to 1,040,000 and kept going. A short while later the server crashed and we got this error.

Not sure who is at fault, SE or Factorio. I am guessing something in SE changed the map size limit.

```
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-9zuga4\src\surface\chunk.cpp (701): Chunk::Chunk
c:\cygwin64\tmp\factorio-build-9zuga4\src\map\mapgenerationmanager.cpp (162): MapGenerationManager::request
c:\cygwin64\tmp\factorio-build-9zuga4\src\map\mapgenerationmanager.cpp (158): MapGenerationManager::request
c:\cygwin64\tmp\factorio-build-9zuga4\src\map\mapgenerationmanager.cpp (158): MapGenerationManager::request
c:\cygwin64\tmp\factorio-build-9zuga4\src\surface\surface.cpp (1372): Surface::requestToGenerateAndActivateChunks
c:\cygwin64\tmp\factorio-build-9zuga4\src\player.cpp (1392): Player::generateAndActivateNeighborChunks
c:\cygwin64\tmp\factorio-build-9zuga4\src\map\map.cpp (1623): Map::updateEntities
c:\cygwin64\tmp\factorio-build-9zuga4\src\game.cpp (210): Game::update
c:\cygwin64\tmp\factorio-build-9zuga4\src\scenario\scenario.cpp (1292): Scenario::update
c:\cygwin64\tmp\factorio-build-9zuga4\src\scenario\scenario.cpp (1181): Scenario::updateStep
c:\cygwin64\tmp\factorio-build-9zuga4\src\mainloop.cpp (1252): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-9zuga4\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_b58b2d836a9819d647da225885c6a421>,void>::_Do_call
c:\cygwin64\tmp\factorio-build-9zuga4\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 LogitechLEDController::*)(void),LogitechLEDController *>,std::default_delete<std::tuple<void (__cdecl LogitechLEDController::*)(void),LogitechLEDController *> > > >::_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: 00007FFB2DE37034)
00007FFB2DE37034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB2F482651)
00007FFB2F482651 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
7880.586 Error Chunk.cpp:701: Trying to make chunk at unreasonable position [-32769, -9]
Logger::writeStacktrace skipped.
7880.586 Error CrashHandler.cpp:191: Map tick at moment of crash: 63740982
7880.630 Info CrashHandler.cpp:311: Executable CRC: 2520619136
7880.630 Error Util.cpp:97: 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.
7893.896 Uploading log file
7894.379 Error CrashHandler.cpp:262: Heap validation: success.
7894.379 Creating crash dump.
7894.610 CrashDump success
```

Re: Factorio crashed when exploring the edge of the map

Posted: Sun Jul 24, 2022 8:40 pm
by Loewchen
Tell the mod author.

Re: Factorio crashed when exploring the edge of the map

Posted: Mon Jul 25, 2022 1:01 pm
by azesmbog
billbo99 wrote:
Sun Jul 24, 2022 8:33 pm
Not sure who is at fault, SE or Factorio.
no version of the game crashed in the vanilla game on the edge of the map

Re: Factorio crashed when exploring the edge of the map

Posted: Tue Jul 26, 2022 7:25 am
by wobbycarly
billbo99 wrote:
Sun Jul 24, 2022 8:33 pm

Stack trace logging done
7880.586 Error Chunk.cpp:701: Trying to make chunk at unreasonable position [-32769, -9]
Logger::writeStacktrace skipped.
According to https://wiki.factorio.com/Map_generator the maximum map size is defined as 2,000,000 tiles each side. The square root of 4,000,000,000 is roughly 63,245 from the starting the position of (0,0), so the way I read it is the maximum map co-ordinates are (-31622,+31622). Seems like the mod has tried to create a chunk outside this range.

Re: Factorio crashed when exploring the edge of the map

Posted: Tue Jul 26, 2022 9:22 am
by boskid
A "playable" area of the surface is from {-1 000 000, -1 000 000} up to {1 000 000, 1 000 000}. If a position has any coordinate of 1 048 576 (=2^20) (ignoring a sign) such position is considered "not reasonable" and an assert will abort the program because such positions are not expected to appear anywhere given the 1000000 limit on the map generator. This assert is intended to catch different class of issues but if a player induces it intentionally, i do not care. In the log file the crash mentions [-32769, -9] but this is a ChunkPosition, which means the x coordinate was somewhere between -1048608 and -1048577.