Page 1 of 1

[raiguard][2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Sun Nov 17, 2024 8:27 pm
by Stringweasel
What happened
If you flip some of the modded pumps (the valves from the Valves mod mod) the game crashes with

Code: Select all

  76.354 Error Entity.cpp:2337: flipResult.direction != Direction::None was not true
Reproduction
  • Install mod
  • Go into /editor (need editor to flip pumps which are set as operable=false)
  • Place a Overflow or Top-Up valve (any direction)
  • Flip (any direction, H or V)
  • Crash!
The modded pumps
I believe it's caused by the linked + normal connection. The two pumps that crash's pipe connections look like this, or the inverse of this where the normal connection is the input, and the linked the output.

Code: Select all

    { direction = defines.direction.south, position = {0, 0}, flow_direction = "output" },
    { connection_type = "linked", flow_direction = "input", linked_connection_id=31113 - 1 }
It's probably due to this combination. The one-way valve has two linked connections and doesn't cause a crash, but it doesn't mirror correctly, instead it sort-off rotates.

Ref.:
125146

Re: [2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Sun Nov 24, 2024 9:16 pm
by Stringweasel
For easy reproduction try to flip a modified pump with the following pipe connections:

Code: Select all

  pipe_connections =
  {
    { connection_type = "linked", flow_direction = "output", linked_connection_id=31113 },
    { direction = defines.direction.south, position = {0, 0.5}, flow_direction = "input" }
  }

Re: [2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Sat Dec 14, 2024 4:01 pm
by StormTAG
Also ran into this issue. Was not actually connected to any pipes.

Attached a minimum-steps save file.

1. Load save file
2. Copy valve
3. Flip

Re: [2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Fri Dec 27, 2024 2:48 pm
by Krydax
I am running into this HARD CRASH as well. All you need to do is copy a valve with ctrl+c and flip with H or V and boom, crash to desktop.

It's extra frustrating because you can't copy blueprints without living in fear you might have accidentally grabbed a valve and will crash your game. Hoping the devs can fix this one soon!

(this is also my second time writing this comment. My previous one seems to have been deleted by some unknown factor with no notification/explanation and I'm very confused by that)

Re: [2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Mon Jan 13, 2025 3:23 am
by dragon-architect
Gonna +1 this as well. I ran into this issue when attempting to ctrl+x and then h-flip a bit of plumbing with valves. Considering others' reports that this happened with ctrl+c or ctrl+x, I also attempted to just alt+b to blueprint it and flip as a blueprint and still got a hard crash.

Full stack trace from log file:

Code: Select all

  44.730 Info AppManagerStates.cpp:2095: Saving finished
Factorio crashed. Generating symbolized stacktrace, please wait ...
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Util\ReleaseAssert.cpp(7): ReleaseAssertFailed
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Entity\Entity.cpp(2308): Entity::flip
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\EntityToBeBuiltSettings.cpp(37): EntityToBeBuiltSettings::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\DrawBlueprintToBeBuiltLogic.cpp(188): DrawBlueprintToBeBuiltLogic::drawEntitiesCore
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\DrawBlueprintToBeBuiltLogic.cpp(147): DrawBlueprintToBeBuiltLogic::drawEntities
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\BuildingRenderer.cpp(253): BuildingRenderer::drawBlueprintToBeBuilt
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\BuildingRenderer.cpp(199): BuildingRenderer::prepareBuildingInGame
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\BuildingRenderer.cpp(102): BuildingRenderer::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Graphics\GameRenderer.cpp(102): GameRenderer::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\GameView.cpp(1518): GameView::prepareRender
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Game.cpp(330): Game::prepareRender
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\MainLoop.cpp(1143): MainLoop::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\MainLoop.cpp(708): MainLoop::mainLoopStep
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\MainLoop.cpp(412): MainLoop::run
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Main.cpp(1357): fmain
C:\Users\build\AppData\Local\Temp\factorio-build-iHERbO\src\Main.cpp(1379): wmain
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFFC3CB7374)
00007FFFC3CB7374 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFFC4A1CC91)
00007FFFC4A1CC91 (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  53.011 Error Entity.cpp:2308: flipResult.direction != Direction::None was not true
  53.011 Error CrashHandler.cpp:643: Received 22
Logger::writeStacktrace skipped.
  53.011 Error CrashHandler.cpp:190: Map tick at moment of crash: 12600676
  53.068 Info CrashHandler.cpp:318: Executable CRC: 2137041080
  53.068 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.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
  59.220 Uploading log file
  59.235 Error CrashHandler.cpp:270: Heap validation: success.
  59.236 Creating crash dump.
  59.448 CrashDump success

Re: [2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Tue Jan 28, 2025 2:53 pm
by Stringweasel
For reference, another report: 126302

Re: [raiguard][2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Fri Jan 31, 2025 10:06 am
by Toruk
+1 to this - I'm experiencing the same crash as others, same stack trace (Error Entity.cpp:2308: flipResult.direction != Direction::None was not true)

I've been able to reproduce the crash under the following scenarios:
- flipping valve already placed in world
- flipping while placing clipboard copy/paste that contains a valve
- flipping while placing blueprint that contains a valve

Flipping a valve that's in your cursor does *not* produce a crash, but it doesn't produce the correct orientation (e.g. horizontally flipping a valve (either overflow or top-up) with east-facing output rotates the valve so that the output faces south)

Only flipping the overflow and top-up valves create a CTD, but the one-way valve also does not flip correctly (east-facing valve horizontally flips to face south, for example), which has the same incorrect flip direction as the top-up/overflow valves which makes me think that the incorrect flip orientations are also related to this issue.

Re: [raiguard][2.0.19] Crash flipping modded pump: flipResult.direction != Direction::None

Posted: Tue Feb 18, 2025 3:07 am
by raiguard
Thanks for the report, this has been fixed for 2.0.35.