From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bootstrap & memory allocation troubles Date: Sat, 14 Jan 2006 12:40:50 -0500 Message-ID: <873bjqvhjn.fsf-monnier+emacs@gnu.org> References: <20060113155227.GA8439@flame.pc> <87mzhzg75p.fsf-monnier+emacs@gnu.org> <20060113212440.GA77427@flame.pc> <20060113213818.GA18365@flame.pc> <87wth3eqn8.fsf-monnier+emacs@gnu.org> <20060113224220.GA91435@flame.pc> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1137266266 20751 80.91.229.2 (14 Jan 2006 19:17:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Jan 2006 19:17:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 14 20:17:40 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Exqu9-0006DT-BP for ged-emacs-devel@m.gmane.org; Sat, 14 Jan 2006 20:17:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExqnX-0001ME-Dr for ged-emacs-devel@m.gmane.org; Sat, 14 Jan 2006 14:10:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ExpQz-0003Mq-Bq for emacs-devel@gnu.org; Sat, 14 Jan 2006 12:43:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ExpQo-0003Jf-TI for emacs-devel@gnu.org; Sat, 14 Jan 2006 12:43:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ExpQo-0003Jb-Ix for emacs-devel@gnu.org; Sat, 14 Jan 2006 12:43:14 -0500 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ExpTz-0002hO-0O for emacs-devel@gnu.org; Sat, 14 Jan 2006 12:46:31 -0500 Original-Received: from alfajor ([67.71.26.73]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060114174050.TACE17035.tomts5-srv.bellnexxia.net@alfajor>; Sat, 14 Jan 2006 12:40:50 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 7BC90D736A; Sat, 14 Jan 2006 12:40:50 -0500 (EST) Original-To: Giorgos Keramidas In-Reply-To: <20060113224220.GA91435@flame.pc> (Giorgos Keramidas's message of "Sat, 14 Jan 2006 00:42:20 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49091 Archived-At: >>> Can you try and undefine HAVE_POSIX_MEMALIGN so as to tell Emacs not >>> to use it, so we can see if it's related or if it's a completely >>> different problem (maybe a problem with unexec)? >> >>> Hmmm. Comment it out HAVE_POSIX_MEMALIGN in src/config.h allows Emacs >>> to bootstrap quite fine with the new malloc() implementation too. Very >>> nice. At least, we know how to repeat and work around the bug now :) >> >> So the problem is either in the implementation of posix_memalign, or >> in my use of it in src/alloc.c. >> >> Can you try and rebuilt with -DENABLE_CHECKING so as to activate the >> `eassert' I have sprinkled in the src/alloc.c code? >> >> Just to be sure, try with -DENABLE_CHECKING for both cases (with and >> without HAVE_POSIX_MEMALIGN). >> >> Since Emacs's posix_memalign code has already been used for more than >> a year under GNU/Linux and probably more platforms, I'm tempted to say >> the bug is in FreeBSD's new implementation. But you never know. > I configured Emacs with: > env CC='cc' CPPFLAGS='-DENABLE_CHECKING' MAKE='gmake' \ > ./configure --prefix="$HOME/opt" --without-x > On FreeBSD 7.0-CURRENT (amd64) with -DENABLE_CHECKING and the current > posix_memalign(), the build crashes repeatably with: > 2006-01-14 00:21:00.000000 - Generating autoloads for calendar/parse-time.el... > 2006-01-14 00:21:00.000000 - Generating autoloads for calendar/parse-time.el...done > 2006-01-14 00:21:00.000000 - Generating autoloads for progmodes/pascal.el... > 2006-01-14 00:21:00.000000 - Generating autoloads for progmodes/pascal.el...done > 2006-01-14 00:21:01.000000 - > 2006-01-14 00:21:01.000000 - Emacs fatal error: alloc.c:2678: assertion failed: XTYPE (cons_free_list) == 0 Hmm... so all the assertions related to the code that uses posix_memalign succeeded. That makes me more or more suspect it's a bug in FreeBSD's posix_memalign. My gut feeling is that calling `free' on a block returned by `posix_memalign' messes up the malloc library's invariants. Stefan