From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Ponce Newsgroups: gmane.emacs.devel Subject: Re: NT Emacs crashes when selecting a menubar item Date: Mon, 29 Jul 2002 20:16:35 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <3D458683.6050904@dponce.com> References: <3D3EF831.3040008@dponce.com> <200207251807.g6PI7I907645@aztec.santafe.edu> <3D4140EF.4000607@dponce.com> <200207271852.g6RIqmA10723@aztec.santafe.edu> <3D442257.8000602@dponce.com> <200207291730.g6THUL714035@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027966434 31179 127.0.0.1 (29 Jul 2002 18:13:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 29 Jul 2002 18:13:54 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17ZF1l-00086m-00 for ; Mon, 29 Jul 2002 20:13:53 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17ZFJ6-0003Wy-00 for ; Mon, 29 Jul 2002 20:31:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17ZF29-0005ht-00; Mon, 29 Jul 2002 14:14:17 -0400 Original-Received: from smtp-out-6.wanadoo.fr ([193.252.19.25] helo=mel-rto6.wanadoo.fr) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17ZF1f-0005gx-00; Mon, 29 Jul 2002 14:13:48 -0400 Original-Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto6.wanadoo.fr (6.5.007) id 3D186837011BFF73; Mon, 29 Jul 2002 20:13:47 +0200 Original-Received: from dponce.com (80.9.191.189) by mel-rta9.wanadoo.fr (6.5.007) id 3D2A791A009C4ED0; Mon, 29 Jul 2002 20:13:47 +0200 User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1b) Gecko/20020728 X-Accept-Language: fr, en-us, en Original-To: rms@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6149 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6149 > > >Is this comment in w32menu.c inaccurate? > > /* Now GC cannot happen during the lifetime of the widget_value, > so it's safe to store data from a Lisp_String, as long as > local copies are made when the actual menu is created. > Windows takes care of this for normal string items, but > not for owner-drawn items or additional item-info. */ > Yes I think it is inaccurate. IMO, GC cannot happen after the build of the widget_value tree is completed. >If it is inaccurate, why is that? How is it that GC happens in >between creation of the widget value and its use in add_menu_item? >Note that GC ought to be inhibited within set_frame_menubar >from this line > > inhibit_garbage_collection (); > >to this line > > unbind_to (specpdl_count, Qnil); > >Does the GC happen inside that range, or after? >Either way, it's a bug; the question is what bug. > Yes GC seems to happen inside that range when building the widget_value tree. When it happens it can change the address of strings (when compacting the string pool) that are stored in already allocated widget_values. I suppose it explains this comment "/* Don't set wv->name here; GC during the loop might relocate it. */" which appears inside that range.