Welcome to failmalloc. This software generates a shared library which can be loaded by LD_PRELOAD or linked at compilation time.

The idea behind failmalloc is to demonstrate what really happens if memory allocation fails. Unfortunately, most programs in this world are not robust, mostly because programmers are careless, but sometimes because programmers are too brave. Regardless of whatever reasons, the most critical problem is in that there is no good way to see such failures in reality, until a program is deployed into a heavy production system. Clearly, this is too late!