From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.emacs.devel Subject: please set both MALLOC_PERTURB_ and MALLOC_CHECK_ envvars Date: Fri, 27 May 2011 23:50:08 +0200 Message-ID: <874o4fx17z.fsf@rho.meyering.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306533017 5008 80.91.229.12 (27 May 2011 21:50:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 May 2011 21:50:17 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 23:50:14 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QQ4v7-0002FP-0B for ged-emacs-devel@m.gmane.org; Fri, 27 May 2011 23:50:13 +0200 Original-Received: from localhost ([::1]:50599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ4v6-0001rz-B3 for ged-emacs-devel@m.gmane.org; Fri, 27 May 2011 17:50:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ4v4-0001rt-9G for emacs-devel@gnu.org; Fri, 27 May 2011 17:50:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQ4v3-00009U-FJ for emacs-devel@gnu.org; Fri, 27 May 2011 17:50:10 -0400 Original-Received: from mx.meyering.net ([82.230.74.64]:55957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ4v3-00009H-8m for emacs-devel@gnu.org; Fri, 27 May 2011 17:50:09 -0400 Original-Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 9460B6026C; Fri, 27 May 2011 23:50:08 +0200 (CEST) Original-Lines: 33 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.230.74.64 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139781 Archived-At: 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.