Is there any way to suppress the output that glibc generates when memory corruption? This is what i see
make *** glibc detected *** /home/myname/php/sapi/cli/php: free(): invalid pointer: x0045d67f *** ======= Backtrace: ========= /lib/libc.so.6(+0x6eb41)[0x380b41] <snip> ======= Memory map: ======== 00115000-00116000 r-xp 00000000 00:00 0 [vdso] 001d7000-001ee000 r-xp 00000000 ca:01 540738 /lib/libpthread-2.12.2.so 001ee000-001ef000 r--p 00016000 ca:01 540738 /lib/libpthread-2.12.2.so 001ef000-001f0000 rw-p 00017000 ca:01 540738 /lib/libpthread-2.12.2.so <snip>
For the work that I am doing, I didn’t care that make did not succeed (return value! = 0). These messages fill the screen and this makes the rest of my output unreadable. I tried:
make &> /dev/null { make ; } &> /dev/null x=`make 2>&1` &> /dev/null
but none of them will catch the conclusion. If it does not write to stderr, where does this come from? I would like a solution that did not require glibc rebuild if possible.
Here is some code that will give such an error message, but note that this has nothing to do with the code I'm working on (php source code). I just want to disable this type of output from my console.
int main() { char* ptr = (char*)malloc(sizeof("test")); char array[]= "test"; ptr = array; free(ptr); return 0; }
source share