From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: alarm_signal_handler is called too frequently Date: Mon, 25 Oct 2004 16:38:10 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <7E7ABFB6-2693-11D9-9BC4-000D93505B76@swipnet.se> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1098715197 31623 80.91.229.6 (25 Oct 2004 14:39:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2004 14:39:57 +0000 (UTC) Cc: YAMAMOTO Mitsuharu , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 16:39:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CM60S-0002Wk-00 for ; Mon, 25 Oct 2004 16:39:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM686-0001jJ-EW for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2004 10:47:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CM67x-0001hr-Fq for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:47:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CM67w-0001hC-3n for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:47:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM67v-0001gj-Pz for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:47:15 -0400 Original-Received: from [195.54.107.73] (helo=mxfep02.bredband.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CM5zX-0005VU-IA; Mon, 25 Oct 2004 10:38:36 -0400 Original-Received: from coolsville.localdomain ([83.226.180.220] [83.226.180.220]) by mxfep02.bredband.com with ESMTP id <20041025143833.GOEV44.mxfep02.bredband.com@coolsville.localdomain>; Mon, 25 Oct 2004 16:38:33 +0200 In-Reply-To: Original-To: rms@gnu.org X-Mailer: Apple Mail (2.619) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28918 > I looked at this just now (please forgive the delay) and found that > things seem to be rather messed up. > > 1. The code makes provision to handle unexpected kinds of > keyboard/mouse input while the popup menu is popped up, and to handle > timers. That is a nice feature. > > 2. However, popup_get_selection is called inside BLOCK_INPUT, and it > calls timer_check, which can call Lisp code. This seems to be a bug. > > I don't see any way we could make this safe. I think we have to > take out timer processing here. However, I have some doubt that > it really works--see below. > > 3. popup_get_selection is called whenever USE_GTK is not defined, but > popup_get_selection is only defined when USE_X_TOOLKIT. I suspect > this means that Emacs won't build in the non-toolkit mode any more. > Could someone check? It does (FWIW when I update from cvs I run a script that builds the GTK, lesstif, motif, lucid, non-toolkit and non-X versions of Emacs to catch errors like this). That bit is inside a (rather long) section of ifdefs, the structure is like this: #if defined (USE_GTK) || defined (USE_X_TOOLKIT) /* popup_get_selection defined and used here. */ #else /* not USE_X_TOOLKIT && not USE_GTK */ /* Non toolkit code */ #endif so popup_get_selection is not used for the non-toolkit build at all. Jan D. > > > I propose the following change as a way to discover problems like #2 > sooner. Could people try it and say if it crashes? (Strangely, it > does not crash for me when I try C-Mouse-3 just after enabling Font > Lock mode on emacs.c. I wonder why.) It craches, but directly at start before any interaction. Disabling the toolbar (./emacs -q -xrm '*toolBar: 0') makes it start OK, but it does not crash on any popup menu. This is on GNU/Linux, toolkit, GTK and non-toolkit versions. Jan D. > > > *** eval.c 30 Jul 2004 23:43:15 -0400 1.221 > --- eval.c 25 Oct 2004 05:34:28 -0400 > *************** > *** 1975,1981 **** > struct backtrace backtrace; > struct gcpro gcpro1, gcpro2, gcpro3; > > ! if (handling_signal) > abort (); > > if (SYMBOLP (form)) > --- 1985,1991 ---- > struct backtrace backtrace; > struct gcpro gcpro1, gcpro2, gcpro3; > > ! if (handling_signal || INPUT_BLOCKED_P) > abort (); > > if (SYMBOLP (form)) > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel