[2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
[2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
I don't think this crash was fixed in any new releases. It happened when I was tabbed off working on something else while factorio ran in the background. It crashed my entire video driver not just Factorio. It prompted me to open the attached file and post it on the forum.
- Attachments
-
- factorio-previous.log
- (144.35 KiB) Downloaded 20 times
Re: [2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
Looks like you genuinely ran out of memory at the moment of saving.
Re: [2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
I really don’t think I ran out of memory, I have 32 GB with 100 Gb swap. I have never ran out of memory doing anything. Even if I did, it should have been handled gracefully and not break stuff.
Re: [2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
Factorio asks the operating system for memory and if it says "no" all we can do is abort what ever action we were going to do. In this case it did, but then it needed memory for something else which also failed and eventually something gives and the process crashes. I do not know of any way for a user-space process to crash your graphics drivers. Likely they also had an allocation fail which caused them to crash.
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
I really dont think that is what happened because it would require me to have been using 132 gb of memory, which I was not.
Re: [2.0.15] Crash "Error ParallelScenarioSaver.cpp:151: Saving scenario failed: bad allocation"
Keith, not sure how much C++ programming experience you have so sorry if you already know this, but the exact text "bad allocation" was printed because part of the system standard library (not Factorio) threw an exception called `std::bad_alloc` (you can google this). The words "bad allocation" are returned by calling `e.what()` on the exception.
According to the C++ standard, `std::bad_alloc` is thrown when the standard library fails to allocate memory. It does this by asking the operating system for it. For some reason, on your computer the operating system refused; as you say, this could technically be for a reason other than running out of memory. But at any rate, at that point Factorio is out of luck.
Also, as one of the devs say, even though I'm sure you and I have both seen at various times games crash our graphics drivers, that's always always a bug in the graphics driver (and often they are actually associated with security vulnerabilities). Games can issue updates to work around those bugs, "fixing them", but it's always the driver author's fault.
According to the C++ standard, `std::bad_alloc` is thrown when the standard library fails to allocate memory. It does this by asking the operating system for it. For some reason, on your computer the operating system refused; as you say, this could technically be for a reason other than running out of memory. But at any rate, at that point Factorio is out of luck.
Also, as one of the devs say, even though I'm sure you and I have both seen at various times games crash our graphics drivers, that's always always a bug in the graphics driver (and often they are actually associated with security vulnerabilities). Games can issue updates to work around those bugs, "fixing them", but it's always the driver author's fault.