all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* please set both MALLOC_PERTURB_ and MALLOC_CHECK_ envvars
@ 2011-05-27 21:50 Jim Meyering
  2011-05-27 21:57 ` Jim Meyering
  2011-05-29  5:44 ` Paul Eggert
  0 siblings, 2 replies; 10+ messages in thread
From: Jim Meyering @ 2011-05-27 21:50 UTC (permalink / raw)
  To: Emacs development discussions

Now, bootstrapping emacs on Fedora 15 x86_64
(with env settings as below) fails with a segfault.

If you develop emacs, or even if you just build from sources regularly,
on a glibc-based system, do us all a favor and build with these envvar
settings:

    export MALLOC_PERTURB_=$((RANDOM % 255 + 1))
    export MALLOC_CHECK_=3

Why?  Because that helps you expose malloc-related problems far earlier.
I've found numerous bugs that way.  The trouble is that you have to
be ready to debug, or at least ready to retry with

    env MALLOC_PERTURB_=0 MALLOC_CHECK_=0 make ...

to see if things work better without protection.

Until recently, I've been building like this to work around
a problem that I traced back to a commit in emacs several years ago:

    make bootstrap RUN_TEMACS='MALLOC_CHECK_=0 ./temacs'

However, today, even with that, make bootstrap is failing with a
segfault (in various places) that goes away when I turn off malloc
robustness checking via both variables for the whole process
and not just one of them when running temacs:

    MALLOC_PERTURB_=0 MALLOC_CHECK_=0 make bootstrap

That suggests a very recent change (within the last 24 hrs)
makes emacs act to differently when MALLOC_PERTURB_=N causes glibc
to scribble nonzero (N) bytes into each just freed buffer.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-05-30 17:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 21:50 please set both MALLOC_PERTURB_ and MALLOC_CHECK_ envvars Jim Meyering
2011-05-27 21:57 ` Jim Meyering
2011-05-28  0:13   ` Thien-Thi Nguyen
2011-05-28 18:52     ` Jim Meyering
2011-05-30 10:30       ` Jim Meyering
2011-05-30 17:49         ` Andreas Schwab
2011-05-28 20:19   ` Chong Yidong
2011-05-28 20:33     ` Jim Meyering
2011-05-29  5:44 ` Paul Eggert
2011-05-29  7:32   ` Jim Meyering

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.