[0.15.1] Crash when smelting recipe has less than max output

This subforum contains all the issues which we already resolved.
GodricSeer
Inserter
Inserter
Posts: 30
Joined: Fri May 06, 2016 2:01 pm
Contact:

[0.15.1] Crash when smelting recipe has less than max output

Post by GodricSeer »

I am updating the hard crafting mod and have run into a bug. Because the mod has some smelting recipes that have more than one output this code is run:

Code: Select all

for name,furnace in pairs(data.raw["furnace"]) do
	if not furnacesExclude[name] then
		furnace.result_inventory_size = math.max(furnace.result_inventory_size, 2)
	end
end
In addition here are two example recipes:

Code: Select all

data:extend(
{
	{
		type = "recipe",
		name = "iron-plate-nugget",
		category = "smelting",
		subgroup = "iron",
		energy_required = 1,
		ingredients = {{ "iron-nugget", 2}},
		results = {{"iron-plate", 1}},
		icon = "__"..fullModName.."__/graphics/icons/iron-plate.png"
	},
	{
		type = "recipe",
		name = "iron-plate",
		category = "smelting",
		subgroup = "iron",
		energy_required = 3.5,
		ingredients = {{ "iron-ore", 2}},
		results = {{"iron-plate", 1},
				   {"iron-slag", 1}},
		icon = "__"..fullModName.."__/graphics/icons/iron-plate.png"
	}
})
As written this will crash the game when trying to smelt an iron-nugget (as soon as the furnace attempts to generate the products. If I add a second entry to the results for that recipe, it is then fine. Here is the log for one such crash:

Code: Select all

   0.002 2017-04-24 21:20:08; Factorio 0.15.1 (build 29050, win64, steam)
   0.002 Operating system: Windows 7 Service Pack 1
   0.002 Program arguments: "E:\SteamLibrary\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.002 Read data path: E:/SteamLibrary/steamapps/common/Factorio/data
   0.002 Write data path: C:/Users/eckertzs/AppData/Roaming/Factorio
   0.002 Binaries path: E:/SteamLibrary/steamapps/common/Factorio/bin
   0.014 System info: [CPU:         Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz, 4 cores, RAM: 12256MB]
   0.014 Display options: [FullScreen: 1] [VSync: 0] [UIScale: 100%] [MultiSampling: OFF] [Screen: 255]
   0.015 Available display adapters: 1
   0.015  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 1050 Ti {0x05, [0,0], 2048x1152, 32bit, 60Hz}
   0.016 Create display on adapter 0. Size 1280x720 at position [374, 198].
   0.091 Initialised Direct3D:[0] NVIDIA GeForce GTX 1050 Ti; driver: nvd3dumx.dll 22.21.13.8165
   0.099     Video memory size (dedicated video/dedicated system/shared system/available): 4008/0/5872/1680 MB
   0.144 DSound: Starting _dsound_update thread
   0.144 DSound: Enter _dsound_update; tid=8048
   0.144 Device reset internal.
   0.147 Desktop composition is active.
   0.147 Graphics options: [Graphics quality: high] [Video memory usage: all] [Light scale: 100%] [DXT: false]
   0.228 Loading mod core 0.0.0 (data.lua)
   0.237 Loading mod base 0.15.1 (data.lua)
   0.350 Loading mod rso-mod 2.3.5 (data.lua)
   0.432 Loading mod angelsinfiniteores 0.5.4 (data.lua)
   0.512 Loading mod autofill 1.4.6 (data.lua)
   0.594 Loading mod Burner-Filter-Inserter 0.4.0 (data.lua)
   0.672 Loading mod EvoGUI 0.4.108 (data.lua)
   0.750 Loading mod no-hand-crafting 0.14.2 (data.lua)
   0.836 Loading mod hardCrafting 0.5.2 (data.lua)
   0.930 Loading mod base 0.15.1 (data-updates.lua)
   1.009 Loading mod rso-mod 2.3.5 (data-updates.lua)
   1.109 Loading mod hardCrafting 0.5.2 (data-updates.lua)
   1.194 Loading mod angelsinfiniteores 0.5.4 (data-final-fixes.lua)
   1.274 Loading mod no-hand-crafting 0.14.2 (data-final-fixes.lua)
   1.365 Loading mod hardCrafting 0.5.2 (data-final-fixes.lua)
   1.449 Checksum for core: 530912544
   1.449 Checksum of base: 2971180584
   1.449 Checksum of rso-mod: 3437302009
   1.449 Checksum of angelsinfiniteores: 75568263
   1.449 Checksum of autofill: 3086359458
   1.450 Checksum of Burner-Filter-Inserter: 755381519
   1.450 Checksum of BurnerLeech: 0
   1.450 Checksum of EvoGUI: 1040096666
   1.450 Checksum of no-hand-crafting: 1422131931
   1.450 Checksum of hardCrafting: 2841792104
   1.602 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1493082768
   1.602 Info PlayerData.cpp:62: Cloud player-data.json unavailable
   1.705 Loaded shader file E:/SteamLibrary/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
   1.705 Loaded shader file E:/SteamLibrary/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
   1.720 Initial atlas bitmap size is 16384
   1.748 Created atlas bitmap 16384x16378
   2.417 Created atlas bitmap 16384x8948
   2.738 Created atlas bitmap 4096x4004
   2.779 Created atlas bitmap 4096x3644
  15.968 Sprites loaded
  15.968 Convert atlas 4096x4004 to: trilinear-filtering 
  16.071 Convert atlas 4096x3644 to: mipmap 
  16.764 Loading sounds...
  19.124 Custom inputs active: 3
  19.169 Factorio initialised
  24.934 Loading map C:\Users\eckertzs\AppData\Roaming\Factorio\saves\_autosave1.zip: 1654186 bytes.
  24.978 Loading Level.dat: 1873928 bytes.
  24.983 Info Scenario.cpp:133: Map version 0.15.1-0
  25.045 Loading script.dat: 3512 bytes.
  25.047 Checksum for script C:/Users/eckertzs/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 1622069129
  25.061 Checksum for script __rso-mod__/control.lua: 1183093440
  25.068 Checksum for script __autofill__/control.lua: 3189374564
  25.069 Checksum for script __BurnerLeech__/control.lua: 3465042737
  25.073 Checksum for script __EvoGUI__/control.lua: 923323629
  25.074 Checksum for script __no-hand-crafting__/control.lua: 3372813959
  25.079 Checksum for script __hardCrafting__/control.lua: 3855568396
  25.086 Script control.lua:356: AutoFill: Defaults Updated
  93.720 Error CrashHandler.cpp:141: Exception Code: c0000005, Address: 0x000000013febef82
ModuleBase: 0x000000013fae0000, ImageSize: 0117f000, RelativeAddress: 003def82
  93.721 Error CrashHandler.cpp:151: Exception Context:
rax=0000000064f13030, rbx=0000000000000000, rcx=880000fa737e6807,
rdx=000000000b72eee0, rsi=880000fa737e6807, rdi=0000000011b0fa50,
rip=000000013febef82, rsp=000000000b72eec0, rbp=0000000000000001,
 r8=000000000fe891b0,  r9=0000000000000030, r10=000000000b263a08,
r11=00000000115d6040, r12=0000000064e4ec28, r13=0000000000000003,
r14=0000000000000001, r15=0000000000000000
  93.721 Crashed in E:\SteamLibrary\steamapps\common\Factorio\bin\x64\Factorio.exe (0x000000013fae0000 - 0x0000000140c5f000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-86tci8\libraries\stackwalker\stackwalker.cpp (923): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-86tci8\src\util\logger.cpp (354): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-86tci8\src\util\logger.cpp (408): Logger::logStacktrace
c:\cygwin64\tmp\factorio-86tci8\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-86tci8\src\util\crashhandler.cpp (177): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000777BBC10)
00000000777BBC10 (kernel32): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000778C0108)
00000000778C0108 (ntdll): (filename not available): EtwEventSetInformation
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077857958)
0000000077857958 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007786812D)
000000007786812D (ntdll): (filename not available): RtlDecodePointer
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007785855F)
000000007785855F (ntdll): (filename not available): RtlUnwindEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007788BCB8)
000000007788BCB8 (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-86tci8\src\material\productionhelper.cpp (360): ProductionHelper::canGiveProducts
c:\cygwin64\tmp\factorio-86tci8\src\material\productionhelper.cpp (235): ProductionHelper::giveProducts
c:\cygwin64\tmp\factorio-86tci8\src\entity\craftingmachine.cpp (589): CraftingMachine::giveProducts
c:\cygwin64\tmp\factorio-86tci8\src\entity\craftingmachine.cpp (509): CraftingMachine::useRecipeOnSource
c:\cygwin64\tmp\factorio-86tci8\src\entity\craftingmachine.cpp (419): CraftingMachine::update
c:\cygwin64\tmp\factorio-86tci8\src\surface\chunk.cpp (563): Chunk::updateEntities
c:\cygwin64\tmp\factorio-86tci8\src\surface\surface.cpp (968): Surface::update
c:\cygwin64\tmp\factorio-86tci8\src\map\map.cpp (1218): Map::update
c:\cygwin64\tmp\factorio-86tci8\src\game.cpp (157): Game::update
c:\cygwin64\tmp\factorio-86tci8\src\scenario\scenario.cpp (765): Scenario::update
c:\cygwin64\tmp\factorio-86tci8\src\mainloop.cpp (819): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-86tci8\src\mainloop.cpp (688): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-86tci8\src\util\workerthread.cpp (35): WorkerThread::loop
c:\program files (x86)\microsoft visual studio 14.0\vc\include\thr\xthread (247): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl WorkerThread::*)(void) __ptr64,WorkerThread * __ptr64>,std::default_delete<std::tuple<void (__cdecl WorkerThread::*)(void) __ptr64,WorkerThread * __ptr64> > > >::_Run
c:\program files (x86)\microsoft visual studio 14.0\vc\include\thr\xthread (210): std::_Pad::_Call_func
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000777359CD)
00000000777359CD (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007786A561)
000000007786A561 (ntdll): (filename not available): RtlUserThreadStart
  95.892 Error CrashHandler.cpp:106: Map tick at moment of crash: 25514
  95.892 Error Util.cpp:76: 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.
I have also attached my mods folder and a save. Just take a couple nuggets, put them in the furnace and it will crash.
Attachments
_autosave1.zip
(1.58 MiB) Downloaded 117 times
mods.zip
(3.39 MiB) Downloaded 131 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14301
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.1] Crash when smelting recipe has less than max output

Post by Rseding91 »

Thanks for the report. Fixed for the next version :)
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”