[0.14.21] unexpected error on log()empty entity.neigbours

This subforum contains all the issues which we already resolved.
matjojo
Filter Inserter
Filter Inserter
Posts: 338
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

[0.14.21] unexpected error on log()empty entity.neigbours

Post by matjojo »

Tried to log() the entity.neighbours of a free pipe, game crashed.
code that presumabl caused the crash
factorio-current.log
log contents
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.14.21] unexpected error on log()empty entity.neigbours

Post by orzelek »

I don't think that code you posted caused the issue.
Cause of the issue is lited here:

Code: Select all

2597.129 Error MainLoop.cpp:788: Exception at tick 329: Error while running event on_built_entity (ID 6)
__TibiaVectura__/control.lua:31: attempt to index field 'entity' (a nil value)
Code excerpt you posted seems to use created_entity so you have different place in code thats trying to refer to entity.
matjojo
Filter Inserter
Filter Inserter
Posts: 338
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [0.14.21] unexpected error on log()empty entity.neigbours

Post by matjojo »

orzelek wrote:I don't think that code you posted caused the issue.
Cause of the issue is lited here:

Code: Select all

2597.129 Error MainLoop.cpp:788: Exception at tick 329: Error while running event on_built_entity (ID 6)
__TibiaVectura__/control.lua:31: attempt to index field 'entity' (a nil value)
Code excerpt you posted seems to use created_entity so you have different place in code thats trying to refer to entity.

yeah, I realise that that it might look like that, but just after that exerpt:

Code: Select all

2688.220 Info Scenario.cpp:152: Map version 0.14.21-0
2688.269 Checksum for script C:/Users/matth/AppData/Roaming/Factorio/temp/curren
tly-playing/control.lua: 1057114497
2688.274 Checksum for script __TibiaVectura__/control.lua: 1317752470
2701.428 Error CrashHandler.cpp:139: Exception Code: c0000005, Address: 0x00007f
f6be61ce56
you can see I fixed that issue (and I kow what the issue was, I was trying to reference event.entity where it actually should have been event.created_entity). And then loaded up a new map, with the code you see in the code block in the OP.

I recreated the issue, using the mod attached do this:

1: give yourself the item
'/c game.players[1].insert({name = "TibiaVectura", count = 10})'
2: place the entity
3: game freezes and crashes


new command prompt log:

Code: Select all

   0.000  Initializing Steam API.
   0.004 2017-01-27 20:28:18; Factorio 0.14.21 (build 25327, win64, steam)
   0.004 Operating system: Windows 10 (version 1607)
   0.005 Program arguments: "C:\Program Files (x86)\Steam\steamapps\common\Facto
rio\bin\x64\Factorio.exe"
   0.005 Read data path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/
data
   0.005 Write data path: C:/Users/matth/AppData/Roaming/Factorio
   0.005 Binaries path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/b
in
   0.047 System info: [CPU: Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz, 4 cores, R
AM: 12208MB]
   0.092 Display options: [FullScreen: 0] [VSync: 1] [UIScale: 80%] [MultiSampli
ng: OFF] [Screen: 255]
   0.096 Available display adapters: 2
   0.097  [0]: \\.\DISPLAY1 - Intel(R) HD Graphics Family {0x8000005, [0,0], 192
0x1080, 32bit, 60Hz}
   0.097  [1]: \\.\DISPLAY2 - Intel(R) HD Graphics Family {0x01, [-1920,0], 1920
x1080, 32bit, 60Hz}
   0.098 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.503 Initialised Direct3D:[0] Intel(R) HD Graphics Family; driver: igdumdim6
4.dll 20.19.15.4549
   0.517     Video memory size (dedicated video/dedicated system/shared system/a
vailable): 112/0/2048/2157 MB
   0.582 DSound: Starting _dsound_update thread
   0.583 DSound: Enter _dsound_update; tid=8268
   0.583 DSound: Enter _dsound_update; tid=8268Device reset internal.
   0.590 Desktop composition is active.
   0.591 WARNING: You have vsync and desktop composition enabled on Direct3d. Co
nsider disabling vsync to increase performance on some confirgurations.
   0.596 Graphics options: [Graphics quality: low] [Video memory usage: all] [Li
ght scale: 30%] [DXT: auto]
   1.493 Loading mod core 0.0.0 (data.lua)
   1.504 Loading mod base 0.14.21 (data.lua)
   1.759 Loading mod TibiaVectura 0.0.0 (data.lua)
   1.925 Checksum for core: 1291735968
   1.925 Checksum for mod base: 786624017
   1.926 Checksum for mod TibiaVectura: 4015278190
   2.736 Info PlayerData.cpp:55: Local player-data.json available, timestamp 148
5446110
   2.737 Info PlayerData.cpp:60: Cloud player-data.json available, timestamp 148
5358786
   3.151 Initial atlas bitmap size is 8192
   3.159 Created atlas bitmap 8192x6038
   3.206 Created atlas bitmap 4096x4092
   3.212 Created atlas bitmap 4096x684
  16.110 Sprites loaded
  16.110 Convert atlas 4096x4092 to: compressed
  18.335 Convert atlas 4096x684 to: compressed
  19.414 Loading sounds...
  22.645 Custom inputs active: 1
  22.729 Factorio initialised
 199.214 Info Scenario.cpp:152: Map version 0.14.21-0
 199.256 Checksum for script C:/Users/matth/AppData/Roaming/Factorio/temp/curren
tly-playing/control.lua: 1057114497
 199.259 Checksum for script __TibiaVectura__/control.lua: 1317752470
 205.661 Error CrashHandler.cpp:139: Exception Code: c0000005, Address: 0x00007f
f6be61ce56
ModuleBase: 0x00007ff6be3e0000, ImageSize: 011ce000, RelativeAddress: 0023ce56
 205.665 Error CrashHandler.cpp:149: Exception Context:
rax=0000000000000000, rbx=000002aaad140360, rcx=b47482bf61cc0000,
rdx=000002aaabb1b310, rsi=0000000000000006, rdi=000002aab0196250,
rip=00007ff6be61ce56, rsp=000000b8089ff220, rbp=000000b8089ff299,
 r8=0000000000000000,  r9=000000b8089fcdc8, r10=000000b8089fdd70,
r11=000000b8089fdc90, r12=0000000000000006, r13=00007ff6be61a340,
r14=0000000000000001, r15=0000000000000000
 205.667 Crashed in C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x
64\factorio.exe (0x00007ff6be3e0000 - 0x00007ff6bf5ae000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-skvdcq\libraries\stackwalker\stackwalker.cpp (906): Sta
ckWalker::ShowCallstack
c:\cygwin64\tmp\factorio-skvdcq\src\util\logger.cpp (337): Logger::writeStacktra
ce
c:\cygwin64\tmp\factorio-skvdcq\src\util\crashhandler.cpp (105): CrashHandler::w
riteStackTrace
c:\cygwin64\tmp\factorio-skvdcq\src\util\crashhandler.cpp (175): CrashHandler::S
ehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF949D5FA7)
00007FFF949D5FA7 (KERNELBASE): (filename not available): UnhandledExceptionFilte
r
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981FED1B)
00007FFF981FED1B (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981E6BD6)
00007FFF981E6BD6 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981FAB9D)
00007FFF981FAB9D (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF98199913)
00007FFF98199913 (ntdll): (filename not available): RtlImageNtHeaderEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981F9CBA)
00007FFF981F9CBA (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-skvdcq\src\script\luagamescript.cpp (628): LuaGameScrip
t::runEventHandler
c:\cygwin64\tmp\factorio-skvdcq\src\script\luaeventdispatcher.cpp (303): LuaEven
tDispatcher::run<GameAction>
c:\cygwin64\tmp\factorio-skvdcq\src\script\luaeventdispatcher.cpp (208): LuaEven
tDispatcher::dispatch
c:\cygwin64\tmp\factorio-skvdcq\src\gameactiondispatcher.cpp (13): GameActionDis
patcher::sendToListeners
c:\cygwin64\tmp\factorio-skvdcq\src\manualbuilder.cpp (813): ManualBuilder::send
BuildEventForEntity
c:\cygwin64\tmp\factorio-skvdcq\src\manualbuilder.cpp (591): ManualBuilder::buil
dItem
c:\cygwin64\tmp\factorio-skvdcq\src\controller\charactercontroller.cpp (395): Ch
aracterController::buildItem
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (491): GameActionHandl
er::buildItem
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (277): GameActionHandl
er::actionPerformed
c:\cygwin64\tmp\factorio-skvdcq\src\input\inputhandler.cpp (48): InputHandler::f
lushActions
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (319): GameActionHandl
er::update
c:\cygwin64\tmp\factorio-skvdcq\src\mainloop.cpp (754): MainLoop::gameUpdateStep

c:\cygwin64\tmp\factorio-skvdcq\src\mainloop.cpp (630): MainLoop::gameUpdateLoop

c:\cygwin64\tmp\factorio-skvdcq\src\util\workerthread.cpp (34): WorkerThread::lo
op
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 W
orkerThread::*)(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<unsi
gned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF95888364)
00007FFF95888364 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981B70D1)
00007FFF981B70D1 (ntdll): (filename not available): RtlUserThreadStart
 207.777 Error CrashHandler.cpp:106: Map tick at moment of crash: 346
 207.777 Error Util.cpp:77: Unexpected error occurred. If you're running the lat
est version of the game you can help us solve the problem by posting the content
s of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps y
ou know of to reproduce the crash.
new factorio-current.log

Code: Select all

   0.004 2017-01-27 20:28:18; Factorio 0.14.21 (build 25327, win64, steam)
   0.004 Operating system: Windows 10 (version 1607) 
   0.005 Program arguments: "C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.005 Read data path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/data
   0.005 Write data path: C:/Users/matth/AppData/Roaming/Factorio
   0.005 Binaries path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/bin
   0.047 System info: [CPU: Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz, 4 cores, RAM: 12208MB]
   0.092 Display options: [FullScreen: 0] [VSync: 1] [UIScale: 80%] [MultiSampling: OFF] [Screen: 255]
   0.096 Available display adapters: 2
   0.097  [0]: \\.\DISPLAY1 - Intel(R) HD Graphics Family {0x8000005, [0,0], 1920x1080, 32bit, 60Hz}
   0.097  [1]: \\.\DISPLAY2 - Intel(R) HD Graphics Family {0x01, [-1920,0], 1920x1080, 32bit, 60Hz}
   0.098 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.503 Initialised Direct3D:[0] Intel(R) HD Graphics Family; driver: igdumdim64.dll 20.19.15.4549
   0.517     Video memory size (dedicated video/dedicated system/shared system/available): 112/0/2048/2157 MB
   0.582 DSound: Starting _dsound_update thread
   0.583 DSound: Enter _dsound_update; tid=8268
   0.583 DSound: Enter _dsound_update; tid=8268Device reset internal.
   0.590 Desktop composition is active.
   0.591 WARNING: You have vsync and desktop composition enabled on Direct3d. Consider disabling vsync to increase performance on some confirgurations.
   0.596 Graphics options: [Graphics quality: low] [Video memory usage: all] [Light scale: 30%] [DXT: auto]
   1.493 Loading mod core 0.0.0 (data.lua)
   1.504 Loading mod base 0.14.21 (data.lua)
   1.759 Loading mod TibiaVectura 0.0.0 (data.lua)
   1.925 Checksum for core: 1291735968
   1.925 Checksum for mod base: 786624017
   1.926 Checksum for mod TibiaVectura: 4015278190
   2.736 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1485446110
   2.737 Info PlayerData.cpp:60: Cloud player-data.json available, timestamp 1485358786
   3.151 Initial atlas bitmap size is 8192
   3.159 Created atlas bitmap 8192x6038
   3.206 Created atlas bitmap 4096x4092
   3.212 Created atlas bitmap 4096x684
  16.110 Sprites loaded
  16.110 Convert atlas 4096x4092 to: compressed 
  18.335 Convert atlas 4096x684 to: compressed 
  19.414 Loading sounds...
  22.645 Custom inputs active: 1
  22.729 Factorio initialised
 199.214 Info Scenario.cpp:152: Map version 0.14.21-0
 199.256 Checksum for script C:/Users/matth/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 1057114497
 199.259 Checksum for script __TibiaVectura__/control.lua: 1317752470
 205.661 Error CrashHandler.cpp:139: Exception Code: c0000005, Address: 0x00007ff6be61ce56
ModuleBase: 0x00007ff6be3e0000, ImageSize: 011ce000, RelativeAddress: 0023ce56
 205.665 Error CrashHandler.cpp:149: Exception Context:
rax=0000000000000000, rbx=000002aaad140360, rcx=b47482bf61cc0000,
rdx=000002aaabb1b310, rsi=0000000000000006, rdi=000002aab0196250,
rip=00007ff6be61ce56, rsp=000000b8089ff220, rbp=000000b8089ff299,
 r8=0000000000000000,  r9=000000b8089fcdc8, r10=000000b8089fdd70,
r11=000000b8089fdc90, r12=0000000000000006, r13=00007ff6be61a340,
r14=0000000000000001, r15=0000000000000000
 205.667 Crashed in C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\factorio.exe (0x00007ff6be3e0000 - 0x00007ff6bf5ae000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-skvdcq\libraries\stackwalker\stackwalker.cpp (906): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-skvdcq\src\util\logger.cpp (337): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-skvdcq\src\util\logger.cpp (391): Logger::logStacktrace
c:\cygwin64\tmp\factorio-skvdcq\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-skvdcq\src\util\crashhandler.cpp (175): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF949D5FA7)
00007FFF949D5FA7 (KERNELBASE): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981FED1B)
00007FFF981FED1B (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981E6BD6)
00007FFF981E6BD6 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981FAB9D)
00007FFF981FAB9D (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF98199913)
00007FFF98199913 (ntdll): (filename not available): RtlImageNtHeaderEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981F9CBA)
00007FFF981F9CBA (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-skvdcq\src\script\luagamescript.cpp (628): LuaGameScript::runEventHandler
c:\cygwin64\tmp\factorio-skvdcq\src\script\luaeventdispatcher.cpp (303): LuaEventDispatcher::run<GameAction>
c:\cygwin64\tmp\factorio-skvdcq\src\script\luaeventdispatcher.cpp (208): LuaEventDispatcher::dispatch
c:\cygwin64\tmp\factorio-skvdcq\src\gameactiondispatcher.cpp (13): GameActionDispatcher::sendToListeners
c:\cygwin64\tmp\factorio-skvdcq\src\manualbuilder.cpp (813): ManualBuilder::sendBuildEventForEntity
c:\cygwin64\tmp\factorio-skvdcq\src\manualbuilder.cpp (591): ManualBuilder::buildItem
c:\cygwin64\tmp\factorio-skvdcq\src\controller\charactercontroller.cpp (395): CharacterController::buildItem
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (491): GameActionHandler::buildItem
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (277): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-skvdcq\src\input\inputhandler.cpp (48): InputHandler::flushActions
c:\cygwin64\tmp\factorio-skvdcq\src\gameactionhandler.cpp (319): GameActionHandler::update
c:\cygwin64\tmp\factorio-skvdcq\src\mainloop.cpp (754): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-skvdcq\src\mainloop.cpp (630): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-skvdcq\src\util\workerthread.cpp (34): 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: 00007FFF95888364)
00007FFF95888364 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFF981B70D1)
00007FFF981B70D1 (ntdll): (filename not available): RtlUserThreadStart
 207.777 Error CrashHandler.cpp:106: Map tick at moment of crash: 346
 207.777 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.
Attachments
TibiaVectura_0.0.0.zip
This is the mod
(66.38 KiB) Downloaded 76 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16000
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.14.21] unexpected error on log()empty entity.neigbours

Post by Rseding91 »

I fixed the crash-to-desktop for 0.15 but you can't log(neighbours). It's a table of LuaEntity and LuaEntity is not convertible to a string so it fails and will just error out with a message saying you gave it an invalid string.
If you want to get ahold of me I'm almost always on Discord.
matjojo
Filter Inserter
Filter Inserter
Posts: 338
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: [0.14.21] unexpected error on log()empty entity.neigbours

Post by matjojo »

Rseding91 wrote:I fixed the crash-to-desktop for 0.15 but you can't log(neighbours). It's a table of LuaEntity and LuaEntity is not convertible to a string so it fails and will just error out with a message saying you gave it an invalid string.

sweet, thanks for fixing and the heads-up.
Post Reply

Return to “Resolved Problems and Bugs”