emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bootstrap & memory allocation troubles


From: Stefan Monnier
Subject: Re: bootstrap & memory allocation troubles
Date: Sat, 14 Jan 2006 12:40:50 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]