[Rseding91] [2.0.8] Crash on creating an sprite-button with a virtual signal as a tooltip

This subforum contains all the issues which we already resolved.
Plop and run
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Fri Jan 31, 2014 8:47 pm
Contact:

[Rseding91] [2.0.8] Crash on creating an sprite-button with a virtual signal as a tooltip

Post by Plop and run »

Create a frame and try to add the following sprite-button to it:

Code: Select all

    frame.add {
        type = 'sprite-button',
        number = 10,
        sprite = 'virtual-signal/signal-0',
        elem_tooltip = {
            type = 'signal',
            name = 'signal-0',
        }
    }
You will get a crash inside IDWithQuality<SignalIDBase>::setBaseIDFromBaseName

If elem_tooltip is an item instead there will be no crash.
I've also attached a mod as a repro-case. Simply start a new game with this mod and click the shortcut (the red C). The game should immediately crash.

Code: Select all

Factorio crashed. Generating symbolized stacktrace, please wait ...
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\ID\IDWithQuality.cpp(246): IDWithQuality<SignalIDBase>::setBaseIDFromBaseName
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\ID\IDWithQuality.cpp(96): IDWithQuality<SignalIDBase>::IDWithQuality<SignalIDBase>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF79C75FE99)
00007FF79C75FE99 (factorio): (filename not available): SignalID::SignalID
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\ChooseElemID.cpp(36): ChooseElemID::ChooseElemID
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\CustomGuiElement.cpp(179): CustomGuiElement::CustomGuiElement
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\CustomButton.cpp(29): CustomButton::CustomButton
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\CustomSpriteButton.cpp(50): CustomSpriteButton::CustomSpriteButton
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\CustomGuiElement.cpp(66): CustomGuiElementHelperFunctions<CustomSpriteButton,10>::create
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\CustomGui\CustomGuiElement.cpp(315): CustomGuiElement::create
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Script\LuaGuiElement.cpp(438): LuaGuiElement::luaAdd
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Script\LuaBinder.hpp(281): LuaBinder<LuaPermissionGroup>::callWrapperOnObject
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\ldo.c(352): luaD_precall
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\lvm.c(717): luaV_execute
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\lapi.c(1068): f_call
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\ldo.c(137): luaD_rawrunprotected
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\ldo.c(625): luaD_pcall
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\libraries\Lua\lapi.c(1094): lua_pcallk
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Util\LuaHelper.cpp(5026): LuaHelper::pCallWithStackTrace
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Script\LuaGameScript.cpp(689): LuaGameScript::runEventHandler
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Script\LuaEventDispatcher.cpp(765): LuaEventDispatcher::run
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Script\LuaEventDispatcher.cpp(565): LuaEventDispatcher::dispatch
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\GameActionHandler.cpp(4522): GameActionHandler::luaShortcut
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\GameActionHandler.cpp(351): GameActionHandler::actionPerformed
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Input\InputSource.cpp(67): InputSource::flushActions
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Input\PlayerInputSource.cpp(518): PlayerInputSource::flushActions
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\GameActionHandler.cpp(389): GameActionHandler::update
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\MainLoop.cpp(1340): MainLoop::gameUpdateStep
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\MainLoop.cpp(1206): MainLoop::gameUpdateLoop
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\functional(823): std::_Func_impl_no_alloc<`MainLoop::mainLoopStep'::`2'::<lambda_1>,void>::_Do_call
C:\Users\build\AppData\Local\Temp\factorio-build-ykpkdl\src\Util\WorkerThread.cpp(73): WorkerThread::loop
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include\thread(56): std::thread::_Invoke<std::tuple<void (__cdecl*)(ParallelDesyncReportCreator *),ParallelDesyncReportCreator *>,0,1>
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97): thread_start<unsigned int (__cdecl*)(void *),1>
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBFCB17374)
00007FFBFCB17374 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBFD9DCC91)
00007FFBFD9DCC91 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  15.819 Error IDWithQuality.cpp:246: Unsupported
  15.819 Error CrashHandler.cpp:643: Received 22
Logger::writeStacktrace skipped.
  15.819 Error CrashHandler.cpp:190: Map tick at moment of crash: 347257
  15.856 Info CrashHandler.cpp:318: Executable CRC: 1762120216
  15.856 Error Util.cpp:95: 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.
Attachments
sprite-button-crash_0.0.1.zip
(3.83 KiB) Downloaded 13 times
Black blood of the factory
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [2.0.8] Crash on creating an sprite-button with a virtual signal as a tooltip

Post by Rseding91 »

Thanks for the report. It turns out, the elem_type of "signal" has been broken since it was added. I've fixed it, however the API for it is slightly more complicated.

This is what's needed to set it:

Code: Select all

elem_tooltip = {
            type = 'signal',
            signal_type = 'virtual',
            name = 'signal-0',
        }
where the signal_type are the valid values for SignalID.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”