[0.16.51] ERROR: Factorio crashed due to Stack overflow error

This subforum contains all the issues which we already resolved.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

[0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

Hi,
I have a map where it crashes to desktop with no Factorio error message popup.
The log file shows "ERROR: Factorio crashed due to Stack overflow error"
Audio is disabled on the PC so ignore these errors in the log file.

I am not performing any actions at the time of the crash.
It seems to crash at the same second after loading the game each time
Autosaves seem to crash at the same point too.

Fixes attempted:
Loading map without mods: crashes
Copying save file to fresh standalone install: crashes

The base has a lot of construction, deconstruction and logistics jobs, but most of the base is paused.
It is a very big map so expect low UPS.

Savegame and mods download link
(Edit: updated 6th January)
saves.zip contains main game save and an autosave from 1 game minute earlier.

Required mods (for nuclear power to work):
Make Barrels Great Again

Optional mods:
Auto Deconstruct
Auto Research
Biters Begone!
Bot Landfill
Bottleneck
Cliff Deconstruct
Helmod
Production Statistics Monitor HUD
Score Extended

Previous mods used:
Concreep
Concreep Refined
Zoom
Attachments
factorio-current.log
(6.36 KiB) Downloaded 230 times
Last edited by DScoffers on Sun Jan 06, 2019 8:57 am, edited 2 times in total.
Loewchen
Global Moderator
Global Moderator
Posts: 9248
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Loewchen »

There is no crash in the log you posted and you have not even loaded a save yet.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

Apologies. Log file updated.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14318
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Rseding91 »

Do you still have the save and mods that I can reproduce this with?
If you want to get ahold of me I'm almost always on Discord.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

Hi Rseding91,
Original post has been updated with new links to saves and mods.
User avatar
Nosferatu
Filter Inserter
Filter Inserter
Posts: 251
Joined: Fri Jan 20, 2017 4:48 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Nosferatu »

Sounds like the same crash I just had

Version is 0.16.51 - No Mods
Crash happens ~13 seconds after loading without doing anything

Last line in log file says ERROR: Factorio crashed due to Stack overflow error

Log and Save Link:
- Link deleted -

edit: The autosave 30 seconds earlier was crashing too. The autosave 5min and 30 seconds earlier is not crashing.
edit2: Bug solved --> Link removed
Last edited by Nosferatu on Mon Jan 07, 2019 4:42 pm, edited 1 time in total.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

I've just tested Nosferatu's map and it crashes for me too. But interestingly after around 36 seconds. (@60UPS)
Log file attached.
Attachments
factorio-current.log
(3.47 KiB) Downloaded 213 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14318
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Rseding91 »

Thanks for the save file(s). It's now fixed for 0.17.
If you want to get ahold of me I'm almost always on Discord.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

Glad to hear that the bug is fixed for 0.17.

Are you able to explain the cause of the bug?
Is there anyway to fix the save file(s)?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14318
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Rseding91 »

A logic error in train re-pathing that went in a loop and exhausted the stack.
If you want to get ahold of me I'm almost always on Discord.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

OK, thanks.
I tried setting all trains to manual using The Fat Controller mod, but it still crashed, so I presume that once the logic loop has started, then cancelling all re-pathing won't also cancel the loop.

As a fix I've increased the .exe stack size so that I can carry on using the save file (for now).
Rseding91
Factorio Staff
Factorio Staff
Posts: 14318
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by Rseding91 »

DScoffers wrote: Thu Jan 17, 2019 7:30 pm OK, thanks.
I tried setting all trains to manual using The Fat Controller mod, but it still crashed, so I presume that once the logic loop has started, then cancelling all re-pathing won't also cancel the loop.

As a fix I've increased the .exe stack size so that I can carry on using the save file (for now).
The last save you gave me was an infinite loop - increasing the stack size wouldn't have fixed it.

What save are you using that stack overflowed but doesn't once you increase the stack size?
If you want to get ahold of me I'm almost always on Discord.
DScoffers
Inserter
Inserter
Posts: 33
Joined: Fri Sep 23, 2016 1:24 pm
Contact:

Re: [0.16.51] ERROR: Factorio crashed due to Stack overflow error

Post by DScoffers »

I've tested again with the save file I sent to you.
I've also tested again with the autosave from 1 minute after the save file I sent to you.

Both crash at the gametime just after the autosave when using the official factorio.exe
Both don't crash when using the new edited factorioWORKING.exe
I have tested in Steam and standalone install.

First attempt I used editbin in Visual Studio to increase the stack and heap sizes.
The values were shown in decimal (rather than hex), so I entered higher decimal values.
I changed the reserves/commits from 100000/1000 to 200000/2000.
The game still crashed. (I left the above changes in the exe)

Then I used Professional PE Explorer to increase the stack and heap reserves.
The values were shown in hex, so I entered higher hex values.
I changed from 30D40 to 7A120. This equates to changing from 200000 to 500000.

I replaced factorio.exe in the installation folder with factorioWORKING.exe, renamed it, and bingo it worked.
The game has run fine for over 12 hours now.

Swapping back to the official factorio.exe and loading either the original save file or the autosave causes the game to crash.
Loading the newly working 12hr+ save file seems to run ok after 15 minutes on the official factorio.exe, but I can run for longer tonight.

Link: New upload of savefile, autosave, mods, and factorioWORKING.exe
Post Reply

Return to “Resolved Problems and Bugs”