Re: MALLOC_PERTURB_: everyone should set this envvar

2012-06-07 Thread Bill Nottingham
Jim Meyering (j...@meyering.net) said: 
 I posted about MALLOC_PERTURB_ about a year ago,
 
 http://thread.gmane.org/gmane.linux.redhat.fedora.devel/132690
 
 but it is clear that not everyone is setting the variable, so for those
 who didn't take the time last year, or who are new to the subject,
 do yourself a favor and set MALLOC_PERTURB_ to a value in 1..255
 everywhere.

See the 'debugmode' package.

Bill
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: MALLOC_PERTURB_: everyone should set this envvar

2012-06-04 Thread John Reiser
 # http://udrepper.livejournal.com/11429.html
 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))

For supportability (and to help remind you to turn it off before
performance tests), then also consider adding a line such as:
 echo 12 MALLOC_PERTURB_=$MALLOC_PERTURB_   # $HOME/.bash_profile

Also inexpensive:
 export MALLOC_CHECK_=1  # 0: off; 1: announce on stderr; 2: abort
 echo 12 MALLOC_CHECK_=$MALLOC_CHECK_   # $HOME/.bash_profile
which handles double free(), single-byte overruns, etc.

For always on detection of overlapping memcpy() at low cost,
then consider  http://bitwagon.com/glibc-memlap/glibc-memlap.html .

-- 
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: MALLOC_PERTURB_: everyone should set this envvar

2012-06-04 Thread Jim Meyering
John Reiser wrote:
 # http://udrepper.livejournal.com/11429.html
 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))

 For supportability (and to help remind you to turn it off before
 performance tests), then also consider adding a line such as:
  echo 12 MALLOC_PERTURB_=$MALLOC_PERTURB_   # $HOME/.bash_profile

Good idea.  Or have a weekly cron job send clue-bat mail to
yourself reminding you that you do have this envvar set.

For the first year or so during which I had this enabled,
when I'd hit a memory-related problem, I didn't immediately think,
Oh! that may be because I've enabled MALLOC_PERTURB_, so the
above might well help, initially.

If you do add something like that, be sure to use a guard so
that it is printed only for interactive sessions, e.g.,

test -n $PS1  echo 12 MALLOC_PERTURB_=$MALLOC_PERTURB_

Once you've been graced with enough MALLOC_PERTURB_-induced
failures, you get used to it, always remember to include it in
bug reports,... then you can turn that off ;-)
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel