emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: emacs-22.1 with GTK dumps core when Gnome wigets


From: Jan Djärv
Subject: Re: address@hidden: Re: emacs-22.1 with GTK dumps core when Gnome wigets clicked]
Date: Thu, 21 Jun 2007 12:13:29 +0200
User-agent: Thunderbird 2.0.0.4 (X11/20070615)



YAMAMOTO Mitsuharu skrev:
On Sun, 17 Jun 2007 17:49:28 -0400, Richard Stallman <address@hidden> said:

Would someone else (other that Mitsuharu) please study this patch to
check whether it is really correct?  Things like this can be tricky.

Please take a look at the following one instead.  It tries to fix the
following problems of gmalloc.c with HAVE_GTK_AND_PTHREAD in Emacs 22.1.

* HAVE_GTK_AND_PTHREAD was checked before including config.h.
* malloc_initialize_1 called pthread_mutexattr_init that may call malloc.
* _aligned_blocks was not protected.
* __malloc_hook etc. may be modified between its NULL-check and the use.

The patch was corrupted by some mailer so I could not apply it, but:

!   /* Copy the value of __malloc_hook to an automatic variable in case
!      __malloc_hook is modified in another thread between its
!      NULL-check and the use.  */
!   hook = __malloc_hook;
!   return (hook != NULL ? *hook : _malloc_internal) (size);
  }

Assignment is not guaranteed to be atomic. It probably is on 32-bit systems, but you should not assume it.

        Jan D.




reply via email to

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