This question is a follow-up to Why does malloc() or new never return NULL? and SIGKILL while allocating memory in C++:
From the answers there I can understand why a program would be killed when trying to write to memory which was "successfully" allocated by malloc
. However, I see the same problem when using calloc
(on SLC and Ubuntu):
Instead of returning a null pointer, the program is SIGKILLed, so checking the return value of calloc
is futile. But calloc
should not be affected by the "overcommit feature"? (Unless it is relying on malloc
behind the scenes...)