[posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

[posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by Deadlock989 »

Might be some missing validation on the following properties of mining drills:

input_fluid_patch_shadow_sprites
input_fluid_patch_window_base_sprites
input_fluid_patch_window_flow_sprites

Not sure if all three of these are affected but it's hard to tell which one (or two, or three) of the three is the culprit.

Crash can be reproduced when you specify an empty table {} for these properties or some other kind of malformed property.

For all the other sprite/animation properties in mining drills (such as base_picture, input_fluid_patch_shadow_animations etc.), if key properties are missing or nonsensical, the game halts during loading with a helpful error message pointing out the problem. But for one (or all) of the above properties, the game seems to load correctly but then crashes silently on loading a game save.

Code: Select all

Factorio crashed. Generating symbolized stacktrace, please wait ...
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\spritedraworder.cpp (88): SpriteDrawOrder::SpriteDrawOrder
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\spritedraworder.cpp (88): SpriteDrawOrder::SpriteDrawOrder
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\drawqueue.cpp (424): DrawQueue::drawTinted
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\drawqueue.cpp (424): DrawQueue::drawTinted
c:\cygwin64\tmp\factorio-build-eeyboc\src\entity\miningdrill.cpp (314): MiningDrill::draw
c:\cygwin64\tmp\factorio-build-eeyboc\src\entity\miningdrill.cpp (314): MiningDrill::draw
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\entityrenderer.cpp (282): EntityRenderer::prepareRow
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\entityrenderer.cpp (282): EntityRenderer::prepareRow
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\entityrenderer.cpp (186): EntityRenderer::threadJob
c:\cygwin64\tmp\factorio-build-eeyboc\src\graphics\entityrenderer.cpp (186): EntityRenderer::threadJob
c:\cygwin64\tmp\factorio-build-eeyboc\src\util\workerthread.cpp (42): WorkerThread::loop
c:\cygwin64\tmp\factorio-build-eeyboc\src\util\workerthread.cpp (42): 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 RouterBase::*)(void),ServerRouter *>,std::default_delete<std::tuple<void (__cdecl RouterBase::*)(void),ServerRouter *> > > >::_Go
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 RouterBase::*)(void),ServerRouter *>,std::default_delete<std::tuple<void (__cdecl RouterBase::*)(void),ServerRouter *> > > >::_Go
c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.15.26726\include\thr\xthread (209): std::_Pad::_Call_func
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: 00007FF9E5EB7974)
00007FF9E5EB7974 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF9E8B0A271)
00007FF9E8B0A271 (ntdll): (filename not available): RtlUserThreadStart
minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (115): thread_start<unsigned int (__cdecl*)(void * __ptr64)>
Stack trace logging done
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF9E5EB7974)
00007FF9E5EB7974 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FF9E8B0A271)
00007FF9E8B0A271 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  20.871 Error SpriteDrawOrder.cpp:90: Invalid sprite reference. Sprite: EMPTY {x = 0, y = 0, w = 0, h = 0}, 0x0000024dc30a7240
Logger::writeStacktrace skipped.
  20.871 Error CrashHandler.cpp:189: Map tick at moment of crash: 23155698
  20.871 Error Util.cpp:97: 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.
  20.871 Error SpriteDrawOrder.cpp:90: Invalid sprite reference. Sprite: EMPTY {x = 0, y = 0, w = 0, h = 0}, 0x0000024dc30a7240
"If Stalin had a good writeup on programming, would linking that be dangerous?"

posila
Factorio Staff
Factorio Staff
Posts: 5147
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by posila »

Thanks for the report.

Fixed for 0.17.63

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by Deadlock989 »

Thank you.
"If Stalin had a good writeup on programming, would linking that be dangerous?"

posila
Factorio Staff
Factorio Staff
Posts: 5147
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by posila »

I should add ... empty table is not valid sprite definition; but these particular definitions are optional, so you should be able to set them just to "nil" (or omit the definition entirely)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by Deadlock989 »

posila wrote:
Sun Aug 04, 2019 12:24 pm
I should add ... empty table is not valid sprite definition; but these particular definitions are optional, so you should be able to set them just to "nil" (or omit the definition entirely)
I know. It was a mistake. But the game loaded so I thought it was OK. Took me a while to work out what I'd done wrong because you didn't get the same feedback you get from other invalid definitions.
"If Stalin had a good writeup on programming, would linking that be dangerous?"

posila
Factorio Staff
Factorio Staff
Posts: 5147
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.62] Crash if mining drill fluid patch sprites incorrectly specified

Post by posila »

OK, just wanted to be sure you won't be surprised by what I meant by "fixed" :)

Post Reply

Return to “Resolved Problems and Bugs”