[Rseding91] [0.17.26] Simple way to crash the game with nuclear reactors

This subforum contains all the issues which we already resolved.
Post Reply
dinoc
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Mar 30, 2019 5:55 pm
Contact:

[Rseding91] [0.17.26] Simple way to crash the game with nuclear reactors

Post by dinoc »

So, @Bilka asked me to make a report here, since I found a fun edge case that crashes the game.

If you place a nuclear reactor with heat pipe connections closer than one whole tile apart, it works fine, but as soon as you try to connect another reactor to it, it will crash the game.

-Non whole number tiles work fine, they just don't connect to the heat pipes (tested with an even sized 6x6 tile reactor with a heat pipe connection in the middle, worked fine, even when connecting to another of the same reactor type)
-Placing heat pipe next to the problematic connection is fine (tested with the problematic 2x2 tile reactor with connection in the middle, worked fine)
-Placing another reactor that has heat pipes that will line up with the problematic ones will instantly crash the game, every time.

Prototype data for the game crasher reactor:

Code: Select all

{
    type = "reactor",
    name = "game-crasher",
    icon  = "__base__/graphics/icons/nuclear-reactor.png",
    icon_size = 32,
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 0.5, result = "game-crasher"},
    max_health = 400,
    corpse = "medium-remnants",
    consumption = "5MW",
    neighbour_bonus = 0.25,
    energy_source =
    {
      type = "burner",
      fuel_category = "crude-nuclear",
      effectivity = 1,
      fuel_inventory_size = 1,
      burnt_inventory_size = 1
    },
    collision_box = {{-0.8, -0.8}, {0.8, 0.8}},
    selection_box = {{-1, -1}, {1, 1}},
    --the collision box of a reactor is increased by this on the sides where it connects to another reactor:
    --neighbour_collision_increase = 0.25,
    lower_layer_picture =
    {
      filename = "__base__/graphics/entity/nuclear-reactor/reactor-pipes.png",
      width = 160,
      height = 160,
	  scale = 0.4,
      shift = { -0.03125, -0.1875 },
      hr_version =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor-pipes.png",
        width = 320,
        height = 320,
        scale = 0.2,
        shift = { -0.03125, -0.1875 }
      }
    },

    picture =
    {
      layers =
      {
        {
          filename = "__base__/graphics/entity/nuclear-reactor/reactor.png",
          width = 160,
          height = 160,
		  scale = 0.4,
          shift = { -0.03125, -0.1875 },
          hr_version =
          {
            filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor.png",
            width = 320,
            height = 320,
            scale = 0.2,
            shift = { -0.03125, -0.1875 }
          }
        },
        {
          filename = "__base__/graphics/entity/nuclear-reactor/reactor-shadow.png",
          width = 263,
          height = 162,
		  scale = 0.4,
          shift = { 1.625 , 0 },
          draw_as_shadow = true,
          hr_version =
          {
            filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor-shadow.png",
            width = 525,
            height = 323,
            scale = 0.2,
            shift = { 1.625, 0 },
            draw_as_shadow = true
          }
        }
      }
    },

    working_light_picture =
    {
      filename = "__base__/graphics/entity/nuclear-reactor/reactor-lights-color.png",
      width = 160,
      height = 160,
	  scale = 0.4,
      shift = { -0.03125, -0.1875 },
      blend_mode = "additive",
      hr_version =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor-lights-color.png",
        width = 320,
        height = 320,
        scale = 0.2,
        shift = { -0.03125, -0.1875 },
        blend_mode = "additive"
      }
    },

    light = {intensity = 0.6, size = 9.9, shift = {0.0, 0.0}, color = {r = 0.0, g = 1.0, b = 0.0}},

    heat_buffer =
    {
      max_temperature = 500,
      specific_heat = "2MJ",
      max_transfer = "1GW",
      connections =
      {
        {
          position = {-0.5, -0.5},
          direction = defines.direction.north
        },
	{
          position = {0, -0.5},
          direction = defines.direction.north
        },
        {
          position = {0.5, -0.5},
          direction = defines.direction.north
        },
        {
          position = {0.5, -0.5},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0.5},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0.5},
          direction = defines.direction.south
        },
        {
          position = {0, 0.5},
          direction = defines.direction.south
        },
        {
          position = {-0.5, 0.5},
          direction = defines.direction.south
        },
        {
          position = {-0.5, 0.5},
          direction = defines.direction.west
        },
        {
          position = {-0.5, 0},
          direction = defines.direction.west
        },
        {
          position = {-0.5, -0.5},
          direction = defines.direction.west
        }
      }
    },

    connection_patches_connected =
    {
      sheet =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/reactor-connect-patches.png",
        width = 32,
        height = 32,
        variation_count = 12,
        hr_version =
        {
          filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor-connect-patches.png",
          width = 64,
          height = 64,
          variation_count = 12,
          scale = 0.5
        }
      }
    },

    connection_patches_disconnected =
    {
      sheet =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/reactor-connect-patches.png",
        width = 32,
        height = 32,
        variation_count = 12,
        y = 32,
        hr_version =
        {
          filename = "__base__/graphics/entity/nuclear-reactor/hr-reactor-connect-patches.png",
          width = 64,
          height = 64,
          variation_count = 12,
          y = 64,
          scale = 0.5
        }
      }
    },

    connection_patches =
    {
      north =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/connection-patch-north.png",
        width = 160,
        height = 15,
        shift = util.by_pixel(0, -72.5)
      },
      east =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/connection-patch-east.png",
        width = 15,
        height = 160,
        shift = util.by_pixel(72.5, 0)
      },
      south =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/connection-patch-south.png",
        width = 160,
        height = 15,
        shift = util.by_pixel(0, 72.5)
      },
      west =
      {
        filename = "__base__/graphics/entity/nuclear-reactor/connection-patch-west.png",
        width = 15,
        height = 160,
        shift = util.by_pixel(-72.5, 0)
      }
    },

    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65},

    meltdown_action =
    {
      type = "direct",
      action_delivery =
      {
        type = "instant",
        target_effects =
        {
          {
              repeat_count = 100,
              type = "create-trivial-smoke",
              smoke_name = "nuclear-smoke",
              offset_deviation = {{-1, -1}, {1, 1}},
              starting_frame = 3,
              starting_frame_deviation = 5,
              starting_frame_speed = 0,
              starting_frame_speed_deviation = 5,
              speed_from_center = 0.5
          },
          {
            type = "create-entity",
            entity_name = "explosion"
          },
          {
            type = "damage",
            damage = {amount = 200, type = "explosion"}
          },
          {
            type = "create-entity",
            entity_name = "small-scorchmark",
            check_buildability = true
          },
          {
            type = "nested-result",
            action =
            {
              type = "area",
              target_entities = false,
              trigger_from_target = true,
              repeat_count = 300,
              radius = 10,
              action_delivery =
              {
                type = "projectile",
                projectile = "atomic-bomb-wave",
                starting_speed = 0.2
              }
            }
          },
		  {
		    type = "create-entity",
            entity_name = "poison-capsule"
		  }
        }
      }
    }
  }
This is the important bit here:

Code: Select all

connections =
      {
        {
          position = {-0.5, -0.5},
          direction = defines.direction.north
        },
	{
          position = {0, -0.5},
          direction = defines.direction.north
        },
        {
          position = {0.5, -0.5},
          direction = defines.direction.north
        },
        {
          position = {0.5, -0.5},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0.5},
          direction = defines.direction.east
        },
        {
          position = {0.5, 0.5},
          direction = defines.direction.south
        },
        {
          position = {0, 0.5},
          direction = defines.direction.south
        },
        {
          position = {-0.5, 0.5},
          direction = defines.direction.south
        },
        {
          position = {-0.5, 0.5},
          direction = defines.direction.west
        },
        {
          position = {-0.5, 0},
          direction = defines.direction.west
        },
        {
          position = {-0.5, -0.5},
          direction = defines.direction.west
        }
      }

Code: Select all

   0.001 2019-04-09 12:33:00; Factorio 0.17.26 (build 44346, win64, steam)
   0.001 Operating system: Windows 7 Service Pack 1
   0.002 Program arguments: "E:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.002 Read data path: E:/Program Files (x86)/Steam/steamapps/common/Factorio/data
   0.002 Write data path: C:/Users/Isaac/AppData/Roaming/Factorio [16175/114370MB]
   0.002 Binaries path: E:/Program Files (x86)/Steam/steamapps/common/Factorio/bin
   0.010 System info: [CPU: AMD FX(tm)-8320 Eight-Core Processor, 8 cores, RAM: 7640/16348 MB, page: 9388/32695 MB, virtual: 178/8388607 MB, extended virtual: 0 MB]
   0.010 Display options: [FullScreen: 1] [VSync: 0] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: 00] [Lang: en]
   0.030 Available displays: 2
   0.030  [1]: \\.\DISPLAY2 - NVIDIA GeForce GTX 960 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.030  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 960 {0x01, [-1920,0], 1920x1080, 32bit, 60Hz}
   0.084 [Direct3D11] Display: 0, Output: 0, DisplayAdapter: 0, RenderingAdapter: 0; d3dcompiler_47.dll
   0.212 Initialised Direct3D[0]: NVIDIA GeForce GTX 960; id: 10de-1401; driver: nvd3dumx.dll 24.21.13.9924
   0.212   D3D Feature Level: 11.0, DXGI 1.2+, SwapChain: 1,discard,-,-,none
   0.212   BGR 565 Supported: No
   0.212   MaximumFrameLatency: 3, GPUThreadPriority: 0
   0.275 Desktop composition is active.
   0.275 Graphics settings preset: very-high
   0.275   Dedicated video memory size 1960 MB
   0.275 Graphics options: [Graphics quality: normal] [Video memory usage: high] [Light scale: 25%] [DXT: high-quality]
   0.275                   [Max load threads: 32] [Max texture size: 0] [Tex.Stream.: 1] [Rotation quality: normal] [Color: 32bit]
   0.313 DSound: Starting _dsound_update thread
   0.313 DSound: Enter _dsound_update; tid=12184
   0.435 Info ModManager.cpp:240: Found duplicate mod robosubstation, using higher version (0.1.3 > 0.1.2).
   0.443 Loading mod core 0.0.0 (data.lua)
   0.543 Loading mod base 0.17.26 (data.lua)
   0.826 Loading mod Early_Nuclear_Power 0.1.0 (data.lua)
   0.954 Loading mod base 0.17.26 (data-updates.lua)
   1.077 Checksum for core: 3129947997
   1.077 Checksum of base: 1769017779
   1.077 Checksum of Early_Nuclear_Power: 2941160841
   1.722 Warning EnergySourcePrototype.cpp:81: emissions in prototype definition, use emissions_per_second_per_watt (proposed value 1e-05) as emissions will be not used soon: ROOT.generator-equipment.portable-breeder-reactor-equipment.burner
   1.764 Loading sounds...
   1.844 Info PlayerData.cpp:69: Local player-data.json unavailable
   1.845 Info PlayerData.cpp:72: Cloud player-data.json available, timestamp 1554824722
   2.035 Initial atlas bitmap size is 16384
   2.039 Created atlas bitmap 16384x6212 [no-crop]
   2.039 Created atlas bitmap 16384x688 [decal]
   2.040 Created atlas bitmap 16384x1104 [low-object]
   2.041 Created atlas bitmap 16384x656 [mipmap, linear-minification, linear-magnification, linear-mip-level, no-crop, no-scale]
   2.042 Created atlas bitmap 16384x2176 [terrain, mipmap, linear-minification, linear-mip-level, no-crop]
   2.043 Created atlas bitmap 16384x480 [smoke, mipmap, linear-minification, linear-magnification]
   2.043 Created atlas bitmap 16384x456 [not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, no-crop, no-scale]
   2.044 Created atlas bitmap 16384x216 [alpha-mask]
   2.046 Created atlas bitmap 16384x3688 [shadow, linear-magnification, alpha-mask]
   2.047 Created atlas bitmap 16384x384 [shadow, mipmap, linear-magnification, alpha-mask]
   2.142 Created virtual atlas pages 4096x4096x3
   2.153 Texture processor created. GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
   2.789 Parallel Sprite Loader initialized (threads: 7)
   8.776 Sprites loaded
   8.818 Generated mipmaps for atlas of size 16384x1104
   8.848 Generated mipmaps for atlas of size 16384x656
   8.868 Generated mipmaps for atlas of size 16384x2176
   8.888 Generated mipmaps for atlas of size 16384x480
   8.898 Generated mipmaps for atlas of size 16384x456
   8.908 Generated mipmaps for atlas of size 16384x384
   8.967 Generated mipmaps for virtual atlas of size 4096x12288
   8.973 Custom inputs active: 6
   9.089 Factorio initialised
  15.297 Loading map C:\Users\Isaac\AppData\Roaming\Factorio\saves\_autosave3.zip: 4365146 bytes.
  15.347 Loading level.dat: 9549067 bytes.
  15.351 Info Scenario.cpp:161: Map version 0.17.26-1
  16.930 Loading script.dat: 4314 bytes.
  16.935 Checksum for script C:/Users/Isaac/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 1848333929
 380.989 Loading map C:\Users\Isaac\AppData\Roaming\Factorio\saves\_autosave3.zip: 4365146 bytes.
 381.040 Loading level.dat: 9549067 bytes.
 381.044 Info Scenario.cpp:161: Map version 0.17.26-1
 382.569 Loading script.dat: 4314 bytes.
 382.573 Checksum for script C:/Users/Isaac/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 1848333929
 394.815 Loading level.dat: 1417941 bytes.
 394.815 Info Scenario.cpp:161: Map version 0.17.26-1
 395.211 Checksum for script C:/Users/Isaac/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 1848333929
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-xlmpg0\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-xlmpg0\src\util\logger.cpp (376): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-xlmpg0\src\util\logger.cpp (527): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-xlmpg0\src\util\logging.cpp (90): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-build-xlmpg0\src\util\logging.cpp (84): Logging::logAndAbortOrThrow
c:\cygwin64\tmp\factorio-build-xlmpg0\src\heatbuffer.cpp (129): HeatBuffer::connect
c:\cygwin64\tmp\factorio-build-xlmpg0\src\entity\reactor.cpp (126): Reactor::setup
c:\cygwin64\tmp\factorio-build-xlmpg0\src\surface\surface.cpp (184): Surface::setupEntity
c:\cygwin64\tmp\factorio-build-xlmpg0\src\manualbuilder.cpp (1017): ManualBuilder::buildItem
c:\cygwin64\tmp\factorio-build-xlmpg0\src\controller\charactercontroller.cpp (601): CharacterController::buildItem
c:\cygwin64\tmp\factorio-build-xlmpg0\src\gameactionhandler.cpp (667): GameActionHandler::buildItem
c:\cygwin64\tmp\factorio-build-xlmpg0\src\gameactionhandler.cpp (321): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-build-xlmpg0\src\input\inputhandler.cpp (61): InputHandler::flushActions
c:\cygwin64\tmp\factorio-build-xlmpg0\src\gameactionhandler.cpp (364): GameActionHandler::update
c:\cygwin64\tmp\factorio-build-xlmpg0\src\mainloop.cpp (1109): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-xlmpg0\src\mainloop.cpp (981): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-build-xlmpg0\src\util\workerthread.cpp (42): 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 WorkerThread::*)(void),WorkerThread *>,std::default_delete<std::tuple<void (__cdecl WorkerThread::*)(void),WorkerThread *> > > >::_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: 0000000076C1571D)
0000000076C1571D (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076E7385D)
0000000076E7385D (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
 443.327 Error HeatBuffer.cpp:129: This heat connection doesn't match connection of its neighbour.
Logger::writeStacktrace skipped.
 443.327 Error CrashHandler.cpp:177: Map tick at moment of crash: 2521
 443.327 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.
 454.828 Uploading log file
 454.840 Error CrashHandler.cpp:213: Heap validation: success.
 454.841 Creating crash dump.
 455.190 CrashDump success
Attachments
factorio-current.log
(8.3 KiB) Downloaded 114 times

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

Re: [0.17.26] Simple way to crash the game with nuclear reactors

Post by Rseding91 »

Thanks for the report. As you mentioned: reactors where built with the logic requiring heat pipe connections be at least 1 tile distance from each other. The game never enforced that so if anyone defined connections like you did it would just crash.

I've added a check for it for the next version of 0.17 so it will instead error on startup that it's invalid instead of runtime crashing the game.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”