2 ms·
> You can get memory errors outside of malloc() on an OS that overcommits RAM. Did anyone claim otherwise? > Whether that is a SIGSEGV or some other signal, o
by zAy0LfpBZLC8mAC 11y ago
> You can get memory errors outside of malloc() on an OS that overcommits RAM.
Did anyone claim otherwise?
> Whether that is a SIGSEGV or some other signal, or just the heavy boots of the OOM killer nuking your process, doesn't really matter.
It does, because you can catch SIGSEGV.
> The key point is that your program cannot handle them. It is impossible to handle every case.
It can, and it has to, if you don't want it to be defective. (Where "handling" does not mean "continue execution", but "don't corrupt persistent state"--you cannot continue execution with insufficient resources anyway, there is no way around that).
> Result: process death (SIGSEGV? SIGBUS? not sure, but it doesn't matter)
SIGKILL. See above.