From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: [mituharu@math.s.chiba-u.ac.jp: Re: emacs-22.1 with GTK dumps core when Gnome wigets clicked] Date: Thu, 21 Jun 2007 12:13:29 +0200 Message-ID: <467A4F49.9040906@swipnet.se> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1182420878 9262 80.91.229.12 (21 Jun 2007 10:14:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Jun 2007 10:14:38 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 21 12:14:35 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I1JgQ-0007Rw-TT for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 12:14:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1JgQ-0000NV-Bn for ged-emacs-devel@m.gmane.org; Thu, 21 Jun 2007 06:14:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1JgO-0000NQ-FK for emacs-devel@gnu.org; Thu, 21 Jun 2007 06:14:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1JgM-0000NC-V3 for emacs-devel@gnu.org; Thu, 21 Jun 2007 06:14:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1JgM-0000N9-Rl for emacs-devel@gnu.org; Thu, 21 Jun 2007 06:14:30 -0400 Original-Received: from av8-1-sn3.vrr.skanova.net ([81.228.9.183]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I1JgL-000832-Q1; Thu, 21 Jun 2007 06:14:30 -0400 Original-Received: by av8-1-sn3.vrr.skanova.net (Postfix, from userid 502) id A97CE38695; Thu, 21 Jun 2007 12:14:28 +0200 (CEST) Original-Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av8-1-sn3.vrr.skanova.net (Postfix) with ESMTP id 8F02938682; Thu, 21 Jun 2007 12:14:28 +0200 (CEST) Original-Received: from husetbladh.homeip.net (81-235-205-78-no59.tbcn.telia.com [81.235.205.78]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 2CA8537E47; Thu, 21 Jun 2007 12:14:27 +0200 (CEST) User-Agent: Thunderbird 2.0.0.4 (X11/20070615) In-Reply-To: X-detected-kernel: Linux 2.4-2.6 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:73515 Archived-At: YAMAMOTO Mitsuharu skrev: >>>>>> On Sun, 17 Jun 2007 17:49:28 -0400, Richard Stallman 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.