memory corruption and the use or not of MALLOC_CHECK_
a program can have a memory corruption or a double free. therefore, I can use MALLOC_CHECK_ to debug, which is fine. However, I don't want to use this variable in production because it impairs performance and its purpose is for debugging. In this case, I have another problem. If MALLOC_CHECK_ is unset, glibc writes info in some channels, which can be /dev/tty or stderr or syslog. a program that is a server usually wants to detache from the console, which is my case. a server should also close stdin, stdout and stderr, which is my case as well. In my case, glibc can write in stderr, but the fd = 2 can be in use for my purpose (a file, a socket, whatever, but not stderr anymore). Therefore, I'll have glibc write in my file descriptor. what i could is to open /dev/null to 2 so to use the file desciptror.
What I would like to do is to prevent glibc from writing into stderr. I look up the internet for any kernel parameter, but I haven't found anything so far.
Can I configure something to control the behaviour of glibc?