trying to make a mod, accidentally crashed my whole computer
Re: trying to make a mod, accidentally crashed my whole computer
So this is not a bug report (since the bug is not in Factorio) but a feature request to add a kludge to work around broken OSes and replicate some of the kernel's functionality to know how much memory can safely be requested in a given situation (just a hardcoded percentage of total RAM won't work too well, this needs to depend on how much other processes are already using).
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: trying to make a mod, accidentally crashed my whole computer
It was a bug report from the beginning. It would be a feature request if Factorio didn't have a memory check at all, but it does. It just doesn't work properly. If it did, I wouldn't be able to crash my own computer.prg wrote:So this is not a bug report (since the bug is not in Factorio) but a feature request to add a kludge to work around broken OSes and replicate some of the kernel's functionality to know how much memory can safely be requested in a given situation (just a hardcoded percentage of total RAM won't work too well, this needs to depend on how much other processes are already using).
Also, I've said this several times, but Garry's Mod is a good example of where this already works. Gmod will stop itself before using too much memory, and it doesn't wait until you're completely out of memory. It sets its own limits afaik. I've no idea how it does it, though. Factorio could probably use the same method.
Anyway, I've only been asked about 4-5 original questions in this entire thread. The rest have just been people repeating the same questions, forcing me to repeat my answers. I'm sick of it now. From now on, unless someone asks a new question, I'm not even going to bother replying. I'm going to wait for a developer to render final judgement on this thread.
Before I go, let me post a status update here:
Facts:
- I've been able to reproduce the issue three times, on two different sets of hardware. Both computers were running windows 10 home 64bit. I've also reproduced it once in linux, but there the OS stepped in and prevented a total crash.
- Two other people have tried it and both were unable to reproduce it. No one knows why.
- Other games have already solved this issue. Garry's Mod is a good example, since it's the same in the sense that it also has lua modding. Where Factorio's memory check seems to trigger when the OS tells Factorio that it's out of memory, Garry's mod's memory check is different. I believe the Source engine sets its own limit somehow, which means it will never even come close to using all of your memory before it stops itself. Perhaps Factorio can use the same method?
- At first, it seemed like Factorio alone was the cause of the crashes, but now I think that isn't entirely true. Factorio uses all of your ram, and then when you attempt to open another app (or even click a button in the windows UI), you no longer have enough memory to perform the action, and since Windows apparently is stupid as a rock, it crashes itself instead of terminating the Factorio process to clear up memory. So, while Factorio allows for it to happen, the blame is much more on Microsoft's head. We probably can't get them to fix it, though.
Last edited by Divran on Fri May 27, 2016 1:27 pm, edited 1 time in total.
Re: trying to make a mod, accidentally crashed my whole computer
Divran wrote:... I'm going to wait for a developer to render final judgement on this thread.
I already did.Rseding91 wrote:We're not going to spend time working on trying to prevent mods from making infinite loops.
If you want to get ahold of me I'm almost always on Discord.
Re: trying to make a mod, accidentally crashed my whole computer
Well that sure is some judgement, but, if this issue is real, it's pretty naive and it's going to come back to bite you. But if that's the way you want to go *shrugs*
EDIT: oh and this issue was never about infinite loops (this is like the 4th time I say this. God damnit I promised myself to not repeat myself)
inb4 someone asks "what is it about then" when I've already answered that many times as well
inb4 someone asks "why is it naive" or "how is it going to bite us" when I've already answered that many times
EDIT: oh and this issue was never about infinite loops (this is like the 4th time I say this. God damnit I promised myself to not repeat myself)
inb4 someone asks "what is it about then" when I've already answered that many times as well
inb4 someone asks "why is it naive" or "how is it going to bite us" when I've already answered that many times
Re: trying to make a mod, accidentally crashed my whole computer
As far as I can see, the check Factorio is doing is working fine. So Factorio is requesting memory from the system. Two things can happen:Divran wrote:It was a bug report from the beginning. It would be a feature request if Factorio didn't have a memory check at all, but it does. It just doesn't work properly. If it did, I wouldn't be able to crash my own computer.prg wrote:So this is not a bug report (since the bug is not in Factorio) but a feature request to add a kludge to work around broken OSes and replicate some of the kernel's functionality to know how much memory can safely be requested in a given situation (just a hardcoded percentage of total RAM won't work too well, this needs to depend on how much other processes are already using).
- It works.
- It does not work.
Now we're in feature request territory.Divran wrote:Also, I've said this several times, but Garry's Mod is a good example of where this already works. Gmod will stop itself before using too much memory, and it doesn't wait until you're completely out of memory. It sets its own limits afaik. I've no idea how it does it, though. Factorio could probably use the same method.
I share that feeling.Divran wrote:Anyway, I've only been asked about 4-5 original questions in this entire thread. The rest have just been people repeating the same questions, forcing me to repeat my answers. I'm sick of it now. From now on, unless someone asks a new question, I'm not even going to bother replying. I'm going to wait for a developer to render final judgement on this thread.
On Linux with memory overcommitting enabled Factorio never saw an allocation failure so there was nothing it could have done before it was killed. And for the third time: this can be easily prevented by configuring the kernel not to overcommit memory, giving Factorio the opportunity to handle the out of memory condition which it does just fine. Also, the kernel terminating a process is a slightly different issue than the system rebooting.Divran wrote:Before I go, let me post a status update here:
Facts:
- I've been able to reproduce the issue three times, on two different sets of hardware. Both computers were running windows 10 home 64bit. I've also reproduced it once in linux, but there the OS stepped in and prevented a total crash.
Every memory allocation has to be checked for success. There doesn't seem to be anything more fancy in Factorio than "if allocation fails, display error message", which is working fine. Anything that Garry's Mod might be doing would be an addition to that check, not a fix of it.Divran wrote:
- Two other people have tried it and both were unable to reproduce it. No one knows why.
- Other games have already solved this issue. Garry's Mod is a good example, since it's the same in the sense that it also has lua modding. Where Factorio's memory check seems to trigger when the OS tells Factorio that it's out of memory, Garry's mod's memory check is different. I believe the Source engine sets its own limit somehow, which means it will never even come close to using all of your memory before it stops itself. Perhaps Factorio can use the same method?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
-
- Fast Inserter
- Posts: 194
- Joined: Sat Apr 23, 2016 7:11 am
- Contact:
Re: trying to make a mod, accidentally crashed my whole computer
The devs already stated that the wont do anything about it. So we can just stop the discussion here.
Re: trying to make a mod, accidentally crashed my whole computer
prg you keep saying the check already works, but then why was I able to reproduce it on two different computers? I agree with everything else you said in your latest post though
Re: trying to make a mod, accidentally crashed my whole computer
Here's how you allocate memory:Divran wrote:prg you keep saying the check already works, but then why was I able to reproduce it on two different computers? I agree with everything else you said in your latest post though
Code: Select all
Request x bytes of memory from the system
Was there an error? {
Possibly inform the user
Stop what you're doing and return with an error status
}
Use newly allocated memory
In any case the process would be dead and the rest of the system still alive. But we've never seen the Factorio process itself crash because of an out of memory condition. So what you're seeing must be that the whole system dies before the kernel starts denying memory allocations to Factorio. In that case you'd need to add some psychic abilities to Factorio so it knows when to stop requesting memory before the system tells it to.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: trying to make a mod, accidentally crashed my whole computer
In other words, like we both have already said earlier, this is technically windows' fault. Until microsoft fixes it (aka never), Factorio can't use a hard cap to the amount of memory it gives itself because... reasons?
Re: trying to make a mod, accidentally crashed my whole computer
Huh? Where did I say adding such a limit would not be possible? It just wouldn't fix existing functionality but be an additional safety measure. It's questionable whether adding a rarely needed workaround for broken OSes is worth the development time. Seems like the devs decided it isn't. End of story.Divran wrote:In other words, like we both have already said earlier, this is technically windows' fault. Until microsoft fixes it (aka never), Factorio can't use a hard cap to the amount of memory it gives itself because... reasons?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: trying to make a mod, accidentally crashed my whole computer
Alright then I guess this thread is over. It's all microsoft's fault so the only question is whether to ask them to fix it now or wait until problems start happening and ask them then.
/thread
EDIT: and also HOW do we ask them to fix it? There doesn't appear to be any good place to post such a request. eh whatever don't have time to go looking for that
/thread
EDIT: and also HOW do we ask them to fix it? There doesn't appear to be any good place to post such a request. eh whatever don't have time to go looking for that