Page 1 of 1

[posila] [0.17.4] Crash when using SpritePath 'file/'

Posted: Sun Mar 03, 2019 11:27 am
by grilledham
Using a SpritePath with the path 'file/' causes a crash to desktop.

I've tested the same code and it works in 0.16.51.

Code:

Code: Select all

script.on_event(
    defines.events.on_player_created,
    function(event)
        local player = game.players[event.player_index]
        player.gui.center.add {type = 'sprite', sprite = 'file/logo.png'}
    end
)
Logs:

Code: Select all

  13.947 Error CrashHandler.cpp:515: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-ocil06\libraries\stackwalker\stackwalker.cpp (924): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-build-ocil06\src\util\logger.cpp (405): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-build-ocil06\src\util\logger.cpp (515): Logger::logStacktrace
c:\cygwin64\tmp\factorio-build-ocil06\src\util\crashhandler.cpp (169): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-build-ocil06\src\util\crashhandler.cpp (524): CrashHandler::SignalHandler
minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp (219): _seh_filter_exe
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (304): `__scrt_common_main_seh'::`1'::filt$0
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF6DDC3BD18)
00007FF6DDC3BD18 (Factorio): (filename not available): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDF103F7DD)
00007FFDF103F7DD (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDF0FAD856)
00007FFDF0FAD856 (ntdll): (filename not available): RtlWalkFrameChain
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDF103E70E)
00007FFDF103E70E (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-build-ocil06\src\graphics\drawcommandbatch.cpp (278): DrawCommandBatch::drawSprite
c:\cygwin64\tmp\factorio-build-ocil06\src\graphics\imagedraworder.cpp (112): ImageDrawOrder::render
c:\cygwin64\tmp\factorio-build-ocil06\src\graphics\guirenderer.cpp (90): GuiRenderer::render
c:\cygwin64\tmp\factorio-build-ocil06\src\mainloop.cpp (574): MainLoop::mainLoopStep
c:\cygwin64\tmp\factorio-build-ocil06\src\mainloop.cpp (356): MainLoop::run
c:\cygwin64\tmp\factorio-build-ocil06\src\main.cpp (1244): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (288): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDEFD13DC4)
00007FFDEFD13DC4 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFDF1013691)
00007FFDF1013691 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  15.130 Error CrashHandler.cpp:174: Map tick at moment of crash: 2
Attached is the scenario.

Re: [0.17.4] Crash when using SpritePath 'file/'

Posted: Thu Mar 07, 2019 4:06 pm
by Rseding91
Thanks for the report however I can't reproduce any crash. When I try it, the sprite just doesn't render.

Re: [0.17.4] Crash when using SpritePath 'file/'

Posted: Sat Mar 09, 2019 8:34 pm
by grilledham
I tested again in 0.17.9 and it still crashes for me, same error.

Even if it doesn't crash for you, wouldn't you expect it to show the sprite?

Re: [0.17.4] Crash when using SpritePath 'file/'

Posted: Sat Mar 09, 2019 9:49 pm
by Rseding91
"logo.png" is not a valid file path so no I expect it to show nothing.

Re: [0.17.4] Crash when using SpritePath 'file/'

Posted: Mon Mar 11, 2019 7:44 pm
by grilledham
Rseding91 wrote:
Sat Mar 09, 2019 9:49 pm
"logo.png" is not a valid file path so no I expect it to show nothing.
Interesting. What would the correct file path be then?

I must say I'm a little confused as the exact same code in 0.16.51 gives me this.
screenshot.png
screenshot.png (3.76 MiB) Viewed 3025 times

Re: [0.17.4] Crash when using SpritePath 'file/'

Posted: Fri May 17, 2019 9:13 am
by Bilka
I can reproduce this with the attached scenario, I hit a log and abort that was added in a later version. "Error ImageDrawOrder.cpp:61: Invalid sprite reference. Sprite: C:\Users\Erik\Documents\GitHub\Factorio\temp\currently-playing\logo.png {x = 0, y = 0, w = 512, h = 512}, 0x0000027479ac9af0"

Re: [posila] [0.17.4] Crash when using SpritePath 'file/'

Posted: Fri May 17, 2019 12:18 pm
by posila
Thanks for the report.
Fixed for 0.17.42