[boskid][1.1.61] Crash when using clear_cursor()

This subforum contains all the issues which we already resolved.
Post Reply
Masamune00
Inserter
Inserter
Posts: 27
Joined: Sat Nov 26, 2016 11:48 am
Contact:

[boskid][1.1.61] Crash when using clear_cursor()

Post by Masamune00 »

Hello,

Version : 1.1.61(build59839, win64)

How to reproduce :
Start a new game
Enter the following command :

Code: Select all

/c
function load_spawn(event)
	local playerIndex = event.player_index
	local player = game.players[playerIndex]
	game.print('im called !')
	player.clear_cursor()
end
script.on_event(defines.events.on_player_setup_blueprint,load_spawn)
Do a ctrl + c of a building, it will hard crash factorio (c++ error or something). Whereas the cursor of the player is not empty, and that's why i'm trying to empty it.

Log of crash :

Code: Select all

  12.052 Loading blueprint storage: Local timestamp 1660364345, Cloud timestamp 1660364346
  12.058 Checksum for script C:/Users/Teuteu/AppData/Roaming/Factorio/temp/currently-playing/control.lua: 3795083680
  23.623 Time travel logging:
  15.707 Player 0 ran command: function load_spawn(event)     local playerIndex = event.player_index     local player = game.players[playerIndex]     game.print('im called !')     player.clear_cursor() end script.on_event(defines.events.on_player_setup_blueprint,load_spawn)
  19.706 Player 0 ran command: game.player.cheat_mode=true game.player.force.research_all_technologies()
  23.623 Error CrashHandler.cpp:494: Exception Code: c0000005, Address: 0x00007ff72dcab070
ModuleBase: 0x00007ff72dc50000, ImageSize: 01dbc000, RelativeAddress: 0005b070
  23.623 Error CrashHandler.cpp:500: Access Violation: Read at address 00000000000000B8
  23.623 Error CrashHandler.cpp:514: Exception Context:
rax=0000000000000000, rbx=00000201f5f85040, rcx=0000000000000070,
rdx=00007ff72e42e776, rsi=00000201ab6fb940, rdi=00000201f5c9ced0,
rip=00007ff72dcab070, rsp=00000017a84fec18, rbp=00000017a84fecc9,
 r8=00007ff72dc50000,  r9=0000000000000000, r10=00007ff72f2804c0,
r11=00000017a84fe670, r12=000000000000ffff, r13=00000201fb5f58b0,
r14=00000201f299ff00, r15=0000000000000000
  23.623 Crashed in C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe (0x00007ff72dc50000 - 0x00007ff72fa0c000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-h64fjd\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-h64fjd\src\util\logger.cpp (316): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-h64fjd\src\util\logger.cpp (323): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-h64fjd\src\util\crashhandler.cpp (186): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-build-h64fjd\src\util\crashhandler.cpp (543): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB93AB0057)
00007FFB93AB0057 (KERNELBASE): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95CB53B0)
00007FFB95CB53B0 (ntdll): (filename not available): memset
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95C9C766)
00007FFB95C9C766 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95CB229F)
00007FFB95CB229F (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95C61454)
00007FFB95C61454 (ntdll): (filename not available): RtlRaiseException
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95CB0DCE)
00007FFB95CB0DCE (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-build-h64fjd\src\blueprint\blueprint.hpp (51): Blueprint::empty
c:\cygwin64\tmp\factorio-build-h64fjd\src\gameactionhandler.cpp (4912): GameActionHandler::copy
c:\cygwin64\tmp\factorio-build-h64fjd\src\gameactionhandler.cpp (368): GameActionHandler::actionPerformed
c:\cygwin64\tmp\factorio-build-h64fjd\src\input\inputhandler.cpp (61): InputHandler::flushActions
c:\cygwin64\tmp\factorio-build-h64fjd\src\gameactionhandler.cpp (411): GameActionHandler::update
c:\cygwin64\tmp\factorio-build-h64fjd\src\mainloop.cpp (1245): MainLoop::gameUpdateStep
c:\cygwin64\tmp\factorio-build-h64fjd\src\mainloop.cpp (1108): MainLoop::gameUpdateLoop
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\functional (15732480): std::_Func_impl_no_alloc<<lambda_eca75c17e97731a71dd0aeb64546b756>,void>::_Do_call
c:\cygwin64\tmp\factorio-build-h64fjd\src\util\workerthread.cpp (49): WorkerThread::loop
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\thr\xthread (230): std::_LaunchPad<std::unique_ptr<std::tuple<void (__cdecl LogitechLEDController::*)(void),LogitechLEDController *>,std::default_delete<std::tuple<void (__cdecl LogitechLEDController::*)(void),LogitechLEDController *> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\thr\xthread (209): std::_Pad::_Call_func
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95007034)
00007FFB95007034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFB95C62651)
00007FFB95C62651 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  26.350 Error CrashHandler.cpp:191: Map tick at moment of crash: 693
  26.398 Info CrashHandler.cpp:311: Executable CRC: 2336234303

Goal : Probably off-topic but just in case, it's for a scenario, the goal is to detect a player do a alt + b (with or without shift)/when the cursor changes/when the ctrl c command is used, and that's one of the case where I need to use this event on_player_setup_blueprint, then I do multiple conditions and if all are met, I clear the cursor. Not using just cursor stack event as it's not fired for one of the case.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.61] Crash when using clear_cursor()

Post by boskid »

Thanks for the report. Issue is now fixed for 1.1.66.

Post Reply

Return to “Resolved Problems and Bugs”