[PATCH] Output error message for glibc malloc checking

Michael Pyne mpyne at kde.org
Tue Jun 30 02:17:21 BST 2009


Hi all,

I guess my patch to change MALLOC_CHECK_ to output the error message in 
addition to calling abort() had the effect of spamming the console with tons 
of debugging output as well.

It turns out that the debug message was removed in glibc 2.9 due to complaints 
about it (which is why I didn't notice it -- I'm on 2.10.1).

I didn't want to just give up though as having the actual glibc error printed 
to console is helpful (at least IMO), so I coded up this, which checks if 
glibc is installed and is greater than or equal to version 2.9, otherwise 
leaves MALLOC_CHECK_ at 2.

Two behavior changes are that MALLOC_CHECK_ is only set if glibc is detected 
*AND* if it wasn't already set to a value (before it was unilaterally set to 
2).

I've tried to remain POSIX sh-compatible, please let me know if I've messed 
that up.

The patch is attached.  Any comments?

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: startkde-malloc-check.patch
Type: text/x-patch
Size: 1381 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090629/0f9ecb97/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090629/0f9ecb97/attachment.sig>


More information about the kde-core-devel mailing list