[boskid][0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

This subforum contains all the issues which we already resolved.
Post Reply
Mat46
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Jul 07, 2019 2:14 pm
Contact:

[boskid][0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Mat46 »

Hello

Il have a intermittent problem in the game on manual save or autosave.

In the log, i see 2 errors :
- the first with visual studio 2017
- the second with RailSignalBase

Is this a problem with a mod or something else ?

Thank you for your answer.
Mat

Factorio Log :
factorio-current.log
(75.79 KiB) Downloaded 36 times
Mod List :
mod-list.json
(1.75 KiB) Downloaded 32 times
My save :
Solo.zip
(5.91 MiB) Downloaded 31 times

Loewchen
Global Moderator
Global Moderator
Posts: 7067
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Loewchen »

If you have repeated unrelated crashes you can not reliably reproduce then the issue is your hardware/OS/driver and not the game.

Mat46
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Jul 07, 2019 2:14 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Mat46 »

Ok, i check this.

Thank you
Mat


Mat46
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Jul 07, 2019 2:14 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Mat46 »

Hello

I run Memtest 3 times in the row (for the moment 0 errors). I will continue the test in the next week.

For info, my pc have 5 month. I changed everything except the graphics card and 2 hard drives. (PC Assembled).

I checked all the update for windows, drivers, .. and all is ok.
I uninstalled all versions of visual basic and installed only visual basic 2019 -> Same Problem.
I uninstalled factorio and reinstalled -> Same Problem.

I didn't have the problem in previous versions.

I noticed that I make a manual backup right after loading my save, I don't have the problem.
If I start playing for 5 minutes and save, I have the bug.

I'm going to do other tests by deactivating mods

Thank You
Mat

Mat46
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Jul 07, 2019 2:14 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Mat46 »

Hello

I think i found the problem.

The problem comes from the "Train Construction Site" mod. If I put a rail signal next to the block (see the photo attached), I have the problem.
I will contact the modder to tell him the problem.

Thank you
Mat
Factorio.png
Factorio.png (3.02 MiB) Viewed 1924 times

Loewchen
Global Moderator
Global Moderator
Posts: 7067
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Loewchen »

Mods generally should not be able to cause crashes so this should still be fixed game side. Is the save you provided the save you can reproduce this with?

Mat46
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sun Jul 07, 2019 2:14 pm
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Mat46 »

Hello

Yes, this is the save with which we can reproduce the problem.
I tested it several times with an automatic and manual backup.

Thank You
Mat

dpacbach
Inserter
Inserter
Posts: 40
Joined: Sun Apr 22, 2018 1:09 am
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by dpacbach »

"incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed


note to devs... const_cast is a code smell!

Rseding91
Factorio Staff
Factorio Staff
Posts: 11923
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed

Post by Rseding91 »

dpacbach wrote:
Wed Apr 22, 2020 3:07 am
"incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" failed


note to devs... const_cast is a code smell!
And yet, it doesn't matter.
If you want to get ahold of me I'm almost always on Discord.

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

Re: [boskid][0.18.15] Crash on save: "incomingBlock->getOutboundSignals().count(const_cast<RailSignalBase*>(this))" fail

Post by boskid »

Ok, after wasting too much time trying to find a nice solution i went berserk and fixed it the hard way:
- as stated in 86385, every rail signals will have to have collision masks that collide with each other to prevent multiple rail signals from being placed on the same tile.
- when trying to build a rail signal not on a tile center, the rail signal build position will be changed to be on a tile center (aka floor(x)+0.5)
- flag "placeable-off-grid" on any rail signal will be ignored.
- rail signal collision box is hardcoded to {{-0.2, -0.2}, {0.2, 0.2}} to prevent defining collision box that would not contain a {0,0} point inside preventing multiple signals at the same position from colliding with each other. This is also to make sure signal will be properly found when looking for a too-close signal on adjacent tile.
- if by any chance (or using editor's clone or scripted clone without snap-to-grid) a rail signal would land not on a tile center, it will not be considered valid so it will not bind to the rails
- all the saves from before 1.1.0 will have rail segments recomputed so if there are any signals not on a tile center, they will detach from rails immediately.

Unfortunately there are some assumptions that are important for rail signals logic to work so i will not remove any of those restrictions.

Post Reply

Return to “Resolved Problems and Bugs”