Game will crash to desktop when LuaStack::transfer_stack is called with a stack belonging to an "item-on-ground" entity.
The expected behaviour is the item on the ground to be removed and placed into the new stack.
The new stack does not need to be in the player's inventory for the crash to occur, it also effects chests.
How:
1) Start any game, I used a new freeplay game with no mods enabled.
2) Place an item onto the ground, I used the keyboard keybind to drop a stone furnace.
3) Select the item on the ground with your cusor.
4) Run the command below:
Code: Select all
/c game.player.get_main_inventory().find_empty_stack().transfer_stack(game.player.selected.stack)
Device Details
Code: Select all
0.001 2023-12-21 21:16:33; Factorio 1.1.100 (build 61920, win64, steam)
0.001 Operating system: Windows 10 (build 19045)
0.000 Initializing Steam API.
0.001 Program arguments: "C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe"
0.001 Config path: C:/Users/User/AppData/Roaming/Factorio/config/config.ini
0.001 Read data path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/data
0.001 Write data path: C:/Users/User/AppData/Roaming/Factorio [17321/476323MB]
0.001 Binaries path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/bin
0.012 System info: [CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz, 8 cores, RAM: 10991/16342 MB, page: 19166/25069 MB, virtual: 4336/134217727 MB, extended virtual: 0 MB]
0.040 Memory info:
0.040 [0]: 86D3 SP008GBLFU213B02 8192 MB 2133 MHz 1.2 v
0.040 [1]: 86D3 SP008GBLFU213B02 8192 MB 2133 MHz 1.2 v
0.041 Display options: [FullScreen: 1] [VSync: 0] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
0.482 Video driver: windows
0.482 Available displays: 2
0.483 [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 1070 Ti {0x05, [0,0], 1920x1080, 32bit, 60Hz}
0.484 [1]: \\.\DISPLAY2 - NVIDIA GeForce GTX 1070 Ti {0x01, [-1920,0], 1920x1080, 32bit, 60Hz}
0.565 [Direct3D11] Display: 0, Output: 0, DisplayAdapter: 0, RenderingAdapter: 0; d3dcompiler_47.dll
0.753 Initialised Direct3D[0]: NVIDIA GeForce GTX 1070 Ti; id: 10de-1b82; driver: nvldumdx.dll 30.0.15.1277
0.753 D3D Feature Level: 11.1, DXGI 1.5+, SwapChain: 3,flip-discard,-,-,-,none
0.753 [Local Video Memory] Budget: 7311MB, CurrentUsage: 4MB, Reservation: 0/3783MB
0.753 [Non-Local Vid.Mem.] Budget: 7506MB, CurrentUsage: 0MB, Reservation: 0/3881MB
0.753 Tiled resources: Tier 2
0.753 Unified Memory Architecture: No
0.753 BGR 565 Supported: Yes
0.753 MaximumFrameLatency: 3, GPUThreadPriority: 0
0.753 Graphics settings preset: very-high
0.753 Dedicated video memory size 8079 MB
0.814 Desktop composition is active.
0.814 Graphics options: [Graphics quality: high] [Video memory usage: all] [DXT: high-quality] [Color: 32bit]
0.814 [Max threads (load/render): 32/8] [Max texture size: 0] [Tex.Stream.: 0] [Rotation quality: normal] [Other: STDCWT] [B:0,C:0,S:100]
Crash Log
Code: Select all
15.540 Loading level.dat: 1220727 bytes.
15.540 Info Scenario.cpp:204: Map version 1.1.100-0
15.847 Checksum for script C:/Users/User/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 3702463597
45.918 Time travel logging:
45.916 Player 0 ran command: game.player.get_main_inventory().find_empty_stack().transfer_stack(game.player.selected.stack)
45.918 Error CrashHandler.cpp:639: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\util\logger.cpp (339): Logger::writeStacktrace
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\util\logger.cpp (346): Logger::logStacktrace
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\util\crashhandler.cpp (190): CrashHandler::writeStackTrace
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\util\crashhandler.cpp (650): CrashHandler::SignalHandler
minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp (219): _seh_filter_exe
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (304): `__scrt_common_main_seh'::`1'::filt$0
d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp (290): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA523123AF)
00007FFA523123AF (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA522C14B4)
00007FFA522C14B4 (ntdll): (filename not available): RtlRaiseException
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA52310EBE)
00007FFA52310EBE (ntdll): (filename not available): KiUserExceptionDispatcher
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\entity\itementity.cpp (67): ItemEntity::addToDescription
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\gui\entityinfo.cpp (35): EntityInfo::update
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\graphics\selectedinforenderer.cpp (91): SelectedInfoRenderer::update
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\gameview.cpp (810): GameView::update
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\game.cpp (459): Game::processGameViewFlags
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\game.cpp (441): Game::prepareRender
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\mainloop.cpp (1143): MainLoop::prepare
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\mainloop.cpp (716): MainLoop::mainLoopStep
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\mainloop.cpp (423): MainLoop::run
c:\users\build\appdata\local\temp\factorio-build-y2mhrs\src\main.cpp (1267): wmain
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA50BE7344)
00007FFA50BE7344 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA522C26B1)
00007FFA522C26B1 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
50.182 Error CrashHandler.cpp:195: Map tick at moment of crash: 1757
50.251 Info CrashHandler.cpp:315: Executable CRC: 1510032185
50.251 Error Util.cpp:100: 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.
51.840 Uploading log file
51.856 Error CrashHandler.cpp:266: Heap validation: success.
51.858 Creating crash dump.
52.188 CrashDump success