[1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
ImagineUnicorn1
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Sep 26, 2021 4:46 pm
Contact:

[1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by ImagineUnicorn1 »

SInce the latest update, i cant load my save that were played in the 1.1.39 version. Once i click on the save, the loading bar stops at the end, and the game crashes. This is the current log after the crash. Thank you for your help.

Code: Select all

 0.000 2021-09-26 12:42:49; Factorio 1.1.41 (build 58972, win64, steam)
   0.000 Operating system: Windows 10 (build 19042) 
   0.002 Program arguments: "G:\SteamLibrary\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.002 Read data path: G:/SteamLibrary/steamapps/common/Factorio/data
   0.002 Write data path: C:/Users/emili/AppData/Roaming/Factorio [8075/237844MB]
   0.002 Binaries path: G:/SteamLibrary/steamapps/common/Factorio/bin
   0.021 System info: [CPU: AMD Ryzen 7 3700X 8-Core Processor, 16 cores, RAM: 4668/16310 MB, page: 7433/18742 MB, virtual: 4331/134217727 MB, extended virtual: 0 MB]
   0.021 Display options: [FullScreen: 0] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.025 Available displays: 1
   0.025  [0]: \\.\DISPLAY1 - NVIDIA GeForce RTX 3070 {0x05, [0,0], 2560x1440, 32bit, 165Hz}
   0.066 [Direct3D11] Display: 0, Output: 0, DisplayAdapter: 0, RenderingAdapter: 0; d3dcompiler_47.dll
   0.249 Initialised Direct3D[0]: NVIDIA GeForce RTX 3070; id: 10de-2484; driver: nvldumdx.dll 30.0.14.7168
   0.249   D3D Feature Level: 11.1, DXGI 1.5+, SwapChain: 3,flip-discard,-,-,-,none
   0.249   [Local Video Memory] Budget: 7275MB, CurrentUsage: 4MB, Reservation: 0/3765MB
   0.249   [Non-Local Vid.Mem.] Budget: 7491MB, CurrentUsage: 0MB, Reservation: 0/3873MB
   0.249   Tiled resources: Tier 2
   0.249   Unified Memory Architecture: No
   0.249   BGR 565 Supported: Yes
   0.249   MaximumFrameLatency: 3, GPUThreadPriority: 0
   0.249 Graphics settings preset: very-high
   0.249   Dedicated video memory size 8043 MB
   0.327 Desktop composition is active.
   0.327 Graphics options: [Graphics quality: high] [Video memory usage: all] [DXT: high-quality] [Color: 32bit]
   0.327                   [Max threads (load/render): 32/8] [Max texture size: 0] [Tex.Stream.: 0] [Rotation quality: normal] [Other: STDCWT] [B:0,C:0,S:100]
   0.361 DSound: Starting _dsound_update thread
   0.361 [Audio] Backend:default; Depth:16, Channel:2, Frequency:44100; MixerQuality:linear
   0.361 DSound: Enter _dsound_update; tid=3988
   0.545 Loading mod core 0.0.0 (data.lua)
   0.694 Loading mod base 1.1.41 (data.lua)
   1.279 Loading mod base 1.1.41 (data-updates.lua)
   1.379 Checksum for core: 3952690221
   1.379 Checksum of base: 3501276965
   1.633 Prototype list checksum: 3034860339
   1.674 Loading sounds...
   7.138 Info PlayerData.cpp:73: Local player-data.json unavailable
   7.138 Info PlayerData.cpp:76: Cloud player-data.json available, timestamp 1632582311
   7.348 Initial atlas bitmap size is 16384
   7.382 Created atlas bitmap 16384x16372 [none]
   7.386 Created atlas bitmap 16384x13056 [none]
   7.386 Created atlas bitmap 8192x4188 [decal]
   7.387 Created atlas bitmap 16384x5568 [low-object]
   7.388 Created atlas bitmap 8192x4448 [mipmap, linear-minification, linear-magnification, linear-mip-level]
   7.389 Created atlas bitmap 16384x6064 [terrain, mipmap, linear-minification, linear-mip-level]
   7.389 Created atlas bitmap 4096x3216 [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
   7.389 Created atlas bitmap 4096x1856 [smoke, mipmap, linear-minification, linear-magnification]
   7.390 Created atlas bitmap 4096x3104 [mipmap]
   7.390 Created atlas bitmap 8192x2240 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   7.390 Created atlas bitmap 8192x1496 [alpha-mask]
   7.393 Created atlas bitmap 16384x14768 [shadow, linear-magnification, alpha-mask]
   7.394 Created atlas bitmap 8192x2336 [shadow, mipmap, linear-magnification, alpha-mask]
   7.394 Created atlas bitmap 2048x240 [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
   7.401 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
  42.767 Parallel Sprite Loader initialized (threads: 13)
  48.126 Sprites loaded
  48.138 Generated mipmaps (4) for atlas [3] of size 16384x5568   
  48.149 Generated mipmaps (3) for atlas [4] of size 8192x4448   
  48.160 Generated mipmaps (3) for atlas [5] of size 16384x6064   
  48.170 Generated mipmaps (3) for atlas [6] of size 4096x3216   
  48.181 Generated mipmaps (3) for atlas [7] of size 4096x1856   
  48.209 Generated mipmaps (3) for atlas [8] of size 4096x3104   
  48.220 Generated mipmaps (5) for atlas [9] of size 8192x2240   
  48.231 Generated mipmaps (3) for atlas [12] of size 8192x2336   
  48.247 Custom mipmaps uploaded.
  48.647 Info LuaGameScript.cpp:786: level state size: 11 bytes.
  48.663 Info LuaGameScript.cpp:786: level state size: 1146 bytes.
  48.664 Info LuaGameScript.cpp:786: level state size: 1146 bytes.
  48.790 Factorio initialised
  48.790 Discord overlay detected (DiscordHook64.dll)
  48.828 Steam Storage Quota: 4637/4768
  50.984 Loading map C:\Users\emili\AppData\Roaming\Factorio\saves\JAMBON.zip: 21770890 bytes.
  51.018 Loading level.dat: 61094823 bytes.
  51.022 Info Scenario.cpp:198: Map version 1.1.39-0
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-rzq52c\src\entity\transportline.cpp (872): TransportLine::checkConsistency
c:\cygwin64\tmp\factorio-build-rzq52c\src\entity\transportbeltconnectable.cpp (525): TransportBeltConnectable::checkConsistency
c:\cygwin64\tmp\factorio-build-rzq52c\src\map\map.cpp (2116): Map::checkConsistency
c:\cygwin64\tmp\factorio-build-rzq52c\src\map\map.cpp (1163): Map::setupEntities
c:\cygwin64\tmp\factorio-build-rzq52c\src\map\map.cpp (1180): Map::setupEntities
c:\cygwin64\tmp\factorio-build-rzq52c\src\scenario\scenario.cpp (338): Scenario::loadFactory
c:\cygwin64\tmp\factorio-build-rzq52c\src\scenario\parallelscenarioloader.cpp (161): ParallelScenarioLoader::doLoad
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*)(MapInterface,ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *,NamedBool<EnableReplayTag>),MapInterface,ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *,enum NamedBool<EnableReplayTag>::Enum>,std::default_delete<std::tuple<void (__cdecl*)(MapInterface,ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *,NamedBool<EnableReplayTag>),MapInterface,ParallelScenarioLoader *,MapDeserialiser *,enum InputType,InputHandler *,MultiplayerManagerBase *,enum NamedBool<EnableReplayTag>::Enum> > > >::_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: 00007FFD822A7034)
00007FFD822A7034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFD82CC2651)
00007FFD82CC2651 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  55.745 Error TransportLine.cpp:872: this->items[i].distanceToNext >= 0 was not true
Logger::writeStacktrace skipped.
  55.784 Info CrashHandler.cpp:309: Executable CRC: 3164524790
  55.784 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.
  58.370 Uploading log file
  58.518 Error CrashHandler.cpp:260: Heap validation: success.
  58.519 Creating crash dump.
  58.772 CrashDump success


ImagineUnicorn1
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Sep 26, 2021 4:46 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by ImagineUnicorn1 »

How do i post my save? Sorry for not knowing and thanks again for your help

Loewchen
Global Moderator
Global Moderator
Posts: 8320
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by Loewchen »

See 3638, so if the save is bigger then upload it to googledrive and post a public link.

ImagineUnicorn1
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Sep 26, 2021 4:46 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by ImagineUnicorn1 »

Is that alright?
Attachments
JAMBON.zip
(20.76 MiB) Downloaded 151 times

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by boskid »

I am trying to understand what happened here. The corruption here reminds me of 97743.
100082-broken-line.png
100082-broken-line.png (269.27 KiB) Viewed 2905 times
There is a range of items on a belt where the relative position is wrong as there is an item with negative distance to next (exactly what the consistency check reported). Its not slightly off, it is 8201082 tiles off. Its not a nice number that would suggest a bit flip, unless it was a bit flip that happened 9h 15 minutes before the save file and the transport line was kept running updating the distances between those items (plausible as the save file has 54h)

Yet again i did a "one time" migration that simply flushes the corrupted transport line to fix a save file. If you have any insight into what happened near {-6.5, -147.5} with the transport line i would like to know that, but my feeling is that this was a random bit flip which was noticed by the consistency check that was running due to game version change. For now i am moving this to "1/0 magic"
Attachments
100106-JAMBON-fixed.zip
(18.52 MiB) Downloaded 243 times

ImagineUnicorn1
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Sep 26, 2021 4:46 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by ImagineUnicorn1 »

Oh yeah, i remember seeing that line, but i brushed it off as a visual bug. I dont remember doing anything that could have set it off.

I cant thank you enough for your help, i can finally play again :)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by boskid »

It would be worth for you to check that belt then, because this short piece of transport line 20.5 tiles long managed to accumulate 619356 copper plates on it... because its a blue belt it had to accumulate here for more than 7.64h

Xynariz
Inserter
Inserter
Posts: 29
Joined: Fri Jun 14, 2019 2:41 am
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by Xynariz »

boskid wrote:
Tue Sep 28, 2021 7:07 am
The corruption here reminds me of 97743.
The 8.2 million number is also consistent between the two reports as well. I wish I had something useful to say beyond this, but I thought it worth pointing out that such a specifically large number appeared in both reports, and I can't think of any possible reason why (it's not near a power of 2 or any other number I could imagine causing problems).

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.41] Crash loading save: "TransportLine.cpp:872: this->items.distanceToNext >= 0 was not true"

Post by boskid »

Xynariz wrote:
Wed Sep 29, 2021 9:11 pm
The 8.2 million number is also consistent between the two reports as well. I wish I had something useful to say beyond this, but I thought it worth pointing out that such a specifically large number appeared in both reports, and I can't think of any possible reason why (it's not near a power of 2 or any other number I could imagine causing problems).
Relative item positions on a transport line are using fixed point numbers that are basically int32_t with 8 bits for the part after the decimal point (1/256th precision). That means a range is from -8388608 to 8388607.9961. Value from this bug reports is extremally close to that power of two because of the traces that the corruption happened 9h15 minutes before the save file and the amount of items accumulated which shows it was running (guaranteed) for at least 7.64h. It is however not important because i would need any reproduction (reliable or unreliable) to fix this issue, assuming it is an issue in code.

Post Reply

Return to “1 / 0 magic”