Hi, habrasoobschestvo!
I want to talk about a small problem that I encountered today.
It happens that the program crashes, producing a string starting with "*** glibc detected ***" and accompanied by a large amount of service information. The fact is that glibc has its own memory manager, which, in the case of an attempt to free unallocated memory, starts to panic and think that the internal structures of the memory manager have collapsed.
Of course, the right way to solve this is to otdebazhit program, find the error and / or inform the developer about it. But sometimes the result is needed urgently, and there is no time to do it. In this case, you can try to switch the memory manager glibc in a different mode, less productive, but more resistant to similar errors programmers. You can do it like this:
')
MALLOC_CHECK_ = 0 / path / to / program
The value “0” causes to completely ignore such errors, “1” to display messages about them in stderr, “2” to terminate the program when an error is detected.
Linux libc is newer than 5.4.23 and GNU libc 2.x.