LuaEntity.resource_category crash

This subforum contains all the issues which we already resolved.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

LuaEntity.resource_category crash

Post by binbinhfr »

Hi,

this code works ok for a new vanilla game , listing available resources :

Code: Select all

/c	for name, ent in pairs(game.entity_prototypes) do
			if ent.resource_category == "basic-solid" or ent.resource_category == "basic-fluid" then
				game.player.print( name )
			end
	end
But if you install
bobconfig_0.13.1
boblibrary_0.13.1
bobores_0.13.1
Yuoki_0.3.58

it leads to a crash.

note that ent.resource_category is supposed to return nil if it's not a resource.

Code: Select all

   0.001 2016-08-07 15:28:24; Factorio 0.13.15 (build 23843, win64, alpha)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "c:\Factorio0\bin\x64\factorio0.exe" 
   0.001 Read data path: c:/Factorio0/data
   0.001 Write data path: c:/Factorio0
   0.001 Binaries path: c:/Factorio0/bin
   0.015 Graphics options: [FullScreen: false] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: high] [Light scale: 100%] [Screen: 255] [DXT: false]
   0.016 Available display adapters: 1
   0.016  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 750 Ti {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.016 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.043 Initialised Direct3D:[0] NVIDIA GeForce GTX 750 Ti; driver: nvd3dumx.dll 10.18.13.6839
   0.046     Video memory size (dedicated video/dedicated system/shared system/available): 1992/0/2048/4037 MB
   0.083 Desktop composition is active.
   0.155 Loading mod core 0.0.0 (data.lua)
   0.160 Loading mod base 0.13.15 (data.lua)
   0.243 Loading mod bobconfig 0.13.1 (data.lua)
   0.287 Loading mod boblibrary 0.13.1 (data.lua)
   0.334 Loading mod Yuoki 0.3.58 (data.lua)
   0.408 Loading mod bobores 0.13.1 (data.lua)
   0.477 Loading mod bobconfig 0.13.1 (data-updates.lua)
   0.537 Loading mod bobores 0.13.1 (data-updates.lua)
   0.602 Checksum for core: 2228900852
   0.602 Checksum for mod base: 2626002353
   0.602 Checksum for mod bobconfig: 3903115925
   0.602 Checksum for mod boblibrary: 3719200648
   0.602 Checksum for mod Yuoki: 633836910
   0.602 Checksum for mod bobores: 3064781262
   0.958 Info PlayerData.cpp:45: Local player-data.json available, timestamp 1470576456
   0.958 Info PlayerData.cpp:52: Cloud player-data.json unavailable
   1.077 Initial atlas bitmap size is 16384
   1.079 Created atlas bitmap 16384x8438
   1.387 Created atlas bitmap 4096x1092
   9.923 Sprites loaded
   9.923 Convert atlas 4096x1092 to: trilinear-filtering 
  10.051 Loading sounds...
  11.409 Custom inputs active: 0
  11.442 Factorio initialised
 192.479 Info Scenario.cpp:127: Map version 0.13.15-0
 192.559 Checksum for script c:/Factorio0/temp/currently-playing/control.lua: 900459546
 192.560 Checksum for script __Yuoki__/control.lua: 1545924437
 192.561 Checksum for script __bobores__/control.lua: 3583780511
 195.314 Error CrashHandler.cpp:135: Exception Code: c0000005, Address: 000000014003452B
ModuleBase: 000000013FBB0000, ImageSize: 01119000, RelativeAddress: 0048452b
 195.314 Error CrashHandler.cpp:145: Exception Context:
rax=000000000ee07e60, rbx=00000000041a1fb0, rcx=00000000000000f8,
rdx=697263736500726d, rsi=0000000007a3e900, rdi=0000000049047a60,
rip=000000014003452b, rsp=0000000007a3e860, rbp=00000000041a1fb0,
 r8=00000000041a1fb0,  r9=0000000000000000, r10=000000004908c7d8,
r11=000000000a95b220, r12=000000000000001f, r13=000000000a95b220,
r14=0000000049047a60, r15=0000000000000011
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-dkfubz\libraries\stackwalker\stackwalker.cpp (906): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-dkfubz\src\util\logger.cpp (328): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-dkfubz\src\util\logger.cpp (382): Logger::logStacktrace
c:\cygwin64\tmp\factorio-dkfubz\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-dkfubz\src\util\crashhandler.cpp (155): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007788BC00)
000000007788BC00 (kernel32): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A8FF88)
0000000077A8FF88 (ntdll): (filename not available): EtwEventSetInformation
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A278C8)
0000000077A278C8 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A37E8D)
0000000077A37E8D (ntdll): (filename not available): RtlDecodePointer
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A284CF)
0000000077A284CF (ntdll): (filename not available): RtlUnwindEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A5BAC8)
0000000077A5BAC8 (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-dkfubz\src\script\luaentityprototype.cpp (231): LuaEntityPrototype::luaReadCategory
c:\cygwin64\tmp\factorio-dkfubz\src\script\luabinder.hpp (138): LuaBinder<LuaArithmeticCombinatorControlBehavior>::findAndCallMethod
c:\cygwin64\tmp\factorio-dkfubz\src\script\luabinder.hpp (185): LuaBinder<LuaEntityPrototype>::processCommonLuaIndex
c:\cygwin64\tmp\factorio-dkfubz\src\script\luabinder.hpp (299): LuaBinder<LuaEntityPrototype>::callWrapper
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\ldo.c (320): luaD_precall
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\ldo.c (392): luaD_call
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\lvm.c (129): callTM
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\lvm.c (154): luaV_gettable
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\lvm.c (610): luaV_execute
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\ldo.c (394): luaD_call
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\ldo.c (131): luaD_rawrunprotected
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\ldo.c (590): luaD_pcall
c:\cygwin64\tmp\factorio-dkfubz\libraries\lua\lapi.c (946): lua_pcallk
c:\cygwin64\tmp\factorio-dkfubz\src\script\luagamescript.cpp (955): LuaGameScript::runLuaCommand
c:\cygwin64\tmp\factorio-dkfubz\src\script\luacontext.cpp (185): LuaContext::runLuaCommand
c:\cygwin64\tmp\factorio-dkfubz\src\commandprocessor.cpp (180): CommandProcessor::executeCommand
c:\cygwin64\tmp\factorio-dkfubz\src\commandprocessor.cpp (134): CommandProcessor::process
c:\cygwin64\tmp\factorio-dkfubz\src\gameactionhandler.cpp (2485): GameActionHandler::writeToConsole
c:\cygwin64\tmp\factorio-dkfubz\src\gameactionhandler.cpp (292): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-dkfubz\src\input\inputhandler.cpp (44): InputHandler::flushActions
c:\cygwin64\tmp\factorio-dkfubz\src\gameactionhandler.cpp (328): GameActionHandler::update
c:\cygwin64\tmp\factorio-dkfubz\src\mainloop.cpp (652): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-dkfubz\src\mainloop.cpp (583): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-dkfubz\src\util\workerthread.cpp (33): WorkerThread::loop
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000001405D4133)
00000001405D4133 (factorio0): (filename not available): boost::thread::start_thread_noexcept
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000778059BD)
00000000778059BD (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077A3A2E1)
0000000077A3A2E1 (ntdll): (filename not available): RtlUserThreadStart
 197.455 Error CrashHandler.cpp:106: Map tick at moment of crash: 107
 197.455 Error Util.cpp:77: 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.
factorio-current.log
(7.26 KiB) Downloaded 123 times
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14286
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntity.resource_category crash

Post by Rseding91 »

Fixed for 0.13.16.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”