On 9/2/07, Jim Meyering <[EMAIL PROTECTED]> wrote: > Otavio Salvador <[EMAIL PROTECTED]> wrote: > > > "Matt Davis" <[EMAIL PROTECTED]> writes: > > > >> On 8/31/07, Otavio Salvador <[EMAIL PROTECTED]> wrote: > >>> "Frodo Baggins" <[EMAIL PROTECTED]> writes: > >>> > >>> >>From 9beec03970ed9b4877b67e93a48eaf1e09b1ac9e Mon Sep 17 00:00:00 2001 > >>> > From: Frodo Baggins <[EMAIL PROTECTED]> > >>> > Date: Fri, 31 Aug 2007 07:45:50 +0530 > >>> > Subject: [PATCH] add malloc debugging using MALLOC_CHECK_ > >>> > > >>> > Set environment variable MALLOC_CHECK_ to 2 so that abort() is > >>> > called when libc detects a heap problem. This way we get a memory dump > >>> > to analyse in such conditions. > >>> > >>> I'd like to hear from others about this patch but it looks OK to me. > >> > >> After a brief overview of this patch, and mentally regarding the usage > >> of the MALLOC_CHECK_ environment variable, I think such use is fine. > >> I believe it is best to abort early rather than later because of a > >> toasted heap. > > > > David? Jim? > > I like removing all of the ifdef'd-out cruft, but not the change > that sets MALLOC_CHECK_ in the environment. > MALLOC_CHECK_ is system specific, and besides, libraries (even when > compiled in debug mode) shouldn't be setting environment variables. >
Jim, I understand your logic, and definitely agree. After reading the man, yes it is system specific, and was a concern I might have considered originally. Upon deeper consideration, there is no reasoning to assume that other architectures might implement that variable with completely different results. So yes, it could be dangerous. Although if the debug mode is only implemented by developers, they can merely set the variable before kicking out a debug session. Possibly a comment suggesting that such a variable could be set for enhanced debugging? Just a thought. -Matt _______________________________________________ parted-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/parted-devel

