[0.16.21] Adding a camera with a script crashes the game

Things that has been reported already before.
Post Reply
Zomis
Inserter
Inserter
Posts: 31
Joined: Fri Apr 21, 2017 7:01 pm
Contact:

[0.16.21] Adding a camera with a script crashes the game

Post by Zomis »

Create a new clean map (no mods enabled, only "base") and enter this as a console command:

Code: Select all

/c game.player.gui.center.add({ type = "camera", position = { x = 0, y = 2 } })
I have also tried adding it inside a flow inside a frame with the same result.

Factorio will then hang and then crash.

The following works in 0.16.20 and shows a camera as expected:

Code: Select all

/c local c = game.player.gui.center.add({ type = "camera", position = { x = 0, y = 2 } }); c.style.width = 300; c.style.height = 300
Crash dump:
0.002 2018-02-01 21:20:58; Factorio 0.16.21 (build 35356, win64, steam)
0.002 Operating system: Windows 10 (version 1709)
0.002 Program arguments: "D:\Games\Steam\Program\steamapps\common\Factorio\bin\x64\Factorio.exe" "--wait-to-close" "10636"
0.002 Read data path: D:/Games/Steam/Program/steamapps/common/Factorio/data
0.002 Write data path: C:/Users/Simon/AppData/Roaming/Factorio [5483/113574MB]
0.002 Binaries path: D:/Games/Steam/Program/steamapps/common/Factorio/bin
0.011 System info: [CPU: AMD FX(tm)-8350 Eight-Core Processor , 8 cores, RAM: 5897/16283 MB, page: 6841/19227 MB, virtual: 225/134217727 MB, extended virtual: 0 MB]
0.012 Display options: [FullScreen: 0] [VSync: 0] [UIScale: system (100.0%)] [MultiSampling: OFF] [Screen: 0] [Lang: en]
0.014 Available display adapters: 2
0.014 [0]: \\.\DISPLAY1 - AMD Radeon R9 200 Series {0x8080005, [0,0], 1920x1080, 32bit, 60Hz}
0.014 [1]: \\.\DISPLAY2 - AMD Radeon R9 200 Series {0x80001, [1920,312], 1360x768, 32bit, 60Hz}
0.014 Create display on adapter 0. Size 1280x720 at position [310, 162].
0.168 Initialised Direct3D:[0] AMD Radeon R9 200 Series; driver: aticfx64.dll 22.19.677.257
0.178 Video memory size (dedicated video/dedicated system/shared system/available): 3052/0/8141/4092 MB
0.245 DSound: Starting _dsound_update thread
0.245 DSound: Enter _dsound_update; tid=6796
0.246 Device reset internal.
0.251 Desktop composition is active.
0.251 Graphics settings preset: very-high
0.252 Graphics options: [Graphics quality: normal] [Video memory usage: high] [Light scale: 25%] [DXT: false] [Shader: 1]
0.252 [Parallel sprite loading: 1] [Max texture size: 0/8192] [Bmp cache: 0] [Sprite slicing: 1] [Low quality rotation: 0]
0.778 Loading mod core 0.0.0 (data.lua)
0.800 Loading mod base 0.16.21 (data.lua)
0.986 Loading mod base 0.16.21 (data-updates.lua)
1.052 Checksum for core: 1699148251
1.052 Checksum of base: 429930717
1.346 Loading sounds...
1.459 Info PlayerData.cpp:67: Local player-data.json unavailable
1.459 Info PlayerData.cpp:70: Cloud player-data.json available, timestamp 1517515134
1.609 Loaded shader file D:/Games/Steam/Program/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
1.609 Loaded shader file D:/Games/Steam/Program/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
1.610 Loaded shader file D:/Games/Steam/Program/steamapps/common/Factorio/data/core/graphics/shaders/alpha-mask.cso
1.630 Initial atlas bitmap size is 16384
1.634 Created atlas bitmap 16384x5942 [none]
1.634 Created atlas bitmap 16384x847 [shadow]
1.635 Created atlas bitmap 16384x682 [decal]
1.635 Created atlas bitmap 8192x1500 [mipmap]
1.636 Created atlas bitmap 8192x800 [mipmap, smoke]
1.637 Created atlas bitmap 8192x2112 [linear-minification, mipmap, terrain]
1.638 Created atlas bitmap 8192x1036 [no-crop, trilinear-filtering, icon, light]
1.638 Created atlas bitmap 8192x238 [alpha-mask]
13.052 Sprites loaded
13.052 Convert atlas 8192x1500 to: mipmap
13.104 Convert atlas 8192x800 to: mipmap
13.135 Convert atlas 8192x2112 to: min-linear
13.211 Convert atlas 8192x1036 to: trilinear-filtering
13.252 Convert atlas 8192x238 to: alpha-mask
13.378 Custom inputs active: 0
13.423 Device reset internal.
13.462 Factorio initialised
22.096 Loading Level.dat: 1029863 bytes.
22.097 Info Scenario.cpp:135: Map version 0.16.21-2
22.147 Checksum for script C:/Users/Simon/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 4025882306
27.902 Error CrashHandler.cpp:286: Exception Code: c0000005, Address: 0x00007ff617daec74
ModuleBase: 0x00007ff617330000, ImageSize: 0134e000, RelativeAddress: 00a7ec74
27.902 Error CrashHandler.cpp:292: Access Violation: Read at address 0000000000000018
27.902 Error CrashHandler.cpp:308: Exception Context:
rax=0000000000000000, rbx=0000000000000000, rcx=0000025478e731c0,
rdx=0000025478e73298, rsi=0000025478e73298, rdi=0000025478e731c0,
rip=00007ff617daec74, rsp=000000f870bfe880, rbp=0000000000000000,
r8=0000025478e731c0, r9=0000025419a497c0, r10=0000000000000000,
r11=0000000000000000, r12=00000254119dad20, r13=0000025419116760,
r14=0000025419bd2b70, r15=0000025478e731c0
27.903 Crashed in D:\Games\Steam\Program\steamapps\common\Factorio\bin\x64\Factorio.exe (0x00007ff617330000 - 0x00007ff61867e000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-e1blhl\libraries\stackwalker\stackwalker.cpp (923): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-e1blhl\src\util\logger.cpp (372): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-e1blhl\src\util\logger.cpp (471): Logger::logStacktrace
c:\cygwin64\tmp\factorio-e1blhl\src\util\crashhandler.cpp (127): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-e1blhl\src\util\crashhandler.cpp (334): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF9834294F0)
00007FF9834294F0 (KERNELBASE): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986FE8508)
00007FF986FE8508 (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986FD0F56)
00007FF986FD0F56 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986FE4C3D)
00007FF986FE4C3D (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986F5D1B8)
00007FF986F5D1B8 (ntdll): (filename not available): RtlWalkFrameChain
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986FE3B6E)
00007FF986FE3B6E (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-e1blhl\libraries\agui\src\agui\widget\widget.cpp (1267): agui::Widget::applySizeRestrictionsInternal
c:\cygwin64\tmp\factorio-e1blhl\libraries\agui\src\agui\style.cpp (23): agui::Style::setParent
c:\cygwin64\tmp\factorio-e1blhl\src\gui\style\stylespecification.cpp (163): StyleSpecification::apply
c:\cygwin64\tmp\factorio-e1blhl\src\customgui\customguielement.cpp (94): CustomGuiElement::buildWidgetRecursively
c:\cygwin64\tmp\factorio-e1blhl\src\script\luaguielement.cpp (359): LuaGuiElement::luaAdd
c:\cygwin64\tmp\factorio-e1blhl\src\script\luabinder.hpp (327): LuaBinder<LuaWallControlBehavior>::callWrapper
c:\cygwin64\tmp\factorio-e1blhl\libraries\lua\ldo.c (319): luaD_precall
c:\cygwin64\tmp\factorio-e1blhl\libraries\lua\lvm.c (710): luaV_execute
c:\cygwin64\tmp\factorio-e1blhl\libraries\lua\lapi.c (952): f_call
c:\cygwin64\tmp\factorio-e1blhl\libraries\lua\ldo.c (131): luaD_rawrunprotected
c:\cygwin64\tmp\factorio-e1blhl\libraries\lua\ldo.c (590): luaD_pcall
c:\cygwin64\tmp\factorio-e1blhl\src\script\luagamescript.cpp (1070): LuaGameScript::runLuaCommand
c:\cygwin64\tmp\factorio-e1blhl\src\script\luacontext.cpp (180): LuaContext::runLuaCommand
c:\cygwin64\tmp\factorio-e1blhl\src\commandprocessor.cpp (1357): CommandProcessor::doExecuteCommand
c:\cygwin64\tmp\factorio-e1blhl\src\commandprocessor.cpp (274): CommandProcessor::executeCommand
c:\cygwin64\tmp\factorio-e1blhl\src\commandprocessor.cpp (219): CommandProcessor::process
c:\cygwin64\tmp\factorio-e1blhl\src\gameactionhandler.cpp (3000): GameActionHandler::writeToConsole
c:\cygwin64\tmp\factorio-e1blhl\src\gameactionhandler.cpp (267): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-e1blhl\src\input\inputhandler.cpp (54): InputHandler::flushActions
c:\cygwin64\tmp\factorio-e1blhl\src\gameactionhandler.cpp (305): GameActionHandler::update
c:\cygwin64\tmp\factorio-e1blhl\src\mainloop.cpp (985): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-e1blhl\src\mainloop.cpp (858): MainLoop::gameUpdateLoop
c:\cygwin64\tmp\factorio-e1blhl\src\util\workerthread.cpp (36): WorkerThread::loop
c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.12.25827\include\thr\xthread (232): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl RazerChromaWindowsSDKImpl::*)(void) __ptr64,RazerChromaWindowsSDKImpl * __ptr64>,std::default_delete<std::tuple<void (__cdecl RazerChromaWindowsSDKImpl::*)(void) __ptr64,RazerChromaWindowsSDKImpl * __ptr64> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.12.25827\include\thr\xthread (211): 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: 00007FF9864A1FE4)
00007FF9864A1FE4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF986FAEF91)
00007FF986FAEF91 (ntdll): (filename not available): RtlUserThreadStart
30.103 Error CrashHandler.cpp:128: Map tick at moment of crash: 257
30.103 Error Util.cpp:67: 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.
34.006 Creating crash dump.
34.367 CrashDump success
Last edited by Zomis on Thu Feb 01, 2018 8:33 pm, edited 1 time in total.

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

Re: [0.16.21] Adding a camera with a script crashes the game

Post by Rseding91 »

Thanks for the report. This is a duplicate of viewtopic.php?f=30&t=57375 which is fixed for the next version of 0.16.

I think I'm also going to add automated tests for creating each of the possible GUI elements through script so this kind of thing doesn't happen in the future.
If you want to get ahold of me I'm almost always on Discord.

Zomis
Inserter
Inserter
Posts: 31
Joined: Fri Apr 21, 2017 7:01 pm
Contact:

Re: [0.16.21] Adding a camera with a script crashes the game

Post by Zomis »

Rseding91 wrote:Thanks for the report. This is a duplicate of viewtopic.php?f=30&t=57375 which is fixed for the next version of 0.16.

I think I'm also going to add automated tests for creating each of the possible GUI elements through script so this kind of thing doesn't happen in the future.
I think automated tests would be really good for this, yes.

I searched for a duplicate but didn't find any, wasn't obvious to me that that one was a duplicate. Glad you've fixed it already. Cheers!

Post Reply

Return to “Duplicates”