[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs 22.1 reproducible crash
From: |
Giorgos Keramidas |
Subject: |
Re: Emacs 22.1 reproducible crash |
Date: |
Wed, 8 Aug 2007 13:00:39 +0300 |
On 2007-08-08 11:32, YAMAMOTO Mitsuharu <address@hidden> wrote:
> >>>>> On Tue, 07 Aug 2007 14:03:51 +0200, Jan Dj?rv <address@hidden> said:
>
> >> Same thing, slightly different backtrace this time. I have also
> >> noticed that this is triggered much easier when using the mouse to
> >> open, and close files.
>
> > I think this might be due to the fact that Glib uses posix_memalign,
> > but there is no posix_memalign in gmalloc.c.
>
> Then adding its implementation to gmalloc.c simply work?
This may actually work well. I recall problems with glib and
Emacs since we switched to FreeBSD in a system malloc() which
*does* include posix_memalign().
I haven't checked but it's possible that Emacs, when linked with
GTK+ links with malloc() from gmalloc.c but calls the system
version of posix_memalign(). This could definitely lead to
trouble similar to what we are seeing.
> Index: src/gmalloc.c
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/src/gmalloc.c,v
> retrieving revision 1.25
> diff -c -p -r1.25 gmalloc.c
> *** src/gmalloc.c 7 Aug 2007 08:55:43 -0000 1.25
> --- src/gmalloc.c 8 Aug 2007 02:31:42 -0000
> *************** memalign (alignment, size)
> *** 1857,1862 ****
> --- 1857,1891 ----
> return result;
> }
>
> + #ifndef ENOMEM
> + #define ENOMEM 12
> + #endif
> +
> + #ifndef EINVAL
> + #define EINVAL 22
> + #endif
> +
> + int
> + posix_memalign (memptr, alignment, size)
> + __ptr_t *memptr;
> + __malloc_size_t alignment;
> + __malloc_size_t size;
Excellent, thanks :-)
I will try this with a snapshot of HEAD from CVS in a few minutes :-)