From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: alarm_signal_handler is called too frequently Date: Mon, 25 Oct 2004 09:13:44 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1098710162 11229 80.91.229.6 (25 Oct 2004 13:16:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2004 13:16:02 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 15:15:58 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 1CM4ha-0003DZ-00 for ; Mon, 25 Oct 2004 15:15:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM4pE-0001ms-91 for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2004 09:23:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CM4o4-00016G-6I for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:22:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CM4o0-00013w-3d for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:22:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM4nz-00013E-T9 for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:22:35 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CM4fp-0000ru-D6 for emacs-devel@gnu.org; Mon, 25 Oct 2004 09:14:09 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CM4fQ-00054K-TS; Mon, 25 Oct 2004 09:13:44 -0400 Original-To: YAMAMOTO Mitsuharu In-reply-to: (message from YAMAMOTO Mitsuharu on Sun, 17 Oct 2004 18:36:26 +0900) 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:28907 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28907 > For example, BLOCK_INPUT occurs when a popup menu is activated. > Then the menu takes control of the user input, and BLOCK_INPUT > continues until the user complete the menu operation. The frequent call of alarm_signal_handler was observed also on GNU/Linux (with or without GTK) during a popup menu was shown. Could someone answer the original question below? 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? 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.) *** 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))