From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Core dumps in redisplay. Date: Sun, 27 Feb 2005 22:28:41 +0100 Message-ID: References: <7eee8e4a0b7241b67a0ae97e4923b908@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1109540652 6871 80.91.229.2 (27 Feb 2005 21:44:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 Feb 2005 21:44:12 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 27 22:44:11 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D5WCr-0003ka-E6 for ged-emacs-devel@m.gmane.org; Sun, 27 Feb 2005 22:44:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D5WV5-0001ZJ-OM for ged-emacs-devel@m.gmane.org; Sun, 27 Feb 2005 17:02:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D5WLI-0000B0-9C for emacs-devel@gnu.org; Sun, 27 Feb 2005 16:52:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D5WL6-00005y-3v for emacs-devel@gnu.org; Sun, 27 Feb 2005 16:52:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D5WL5-0008WJ-J3 for emacs-devel@gnu.org; Sun, 27 Feb 2005 16:52:35 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D5Vxz-0003mu-2v for emacs-devel@gnu.org; Sun, 27 Feb 2005 16:28:43 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1D5Vxy-0008Cr-FO; Sun, 27 Feb 2005 16:28:42 -0500 Original-To: "Jan D." In-Reply-To: <7eee8e4a0b7241b67a0ae97e4923b908@swipnet.se> (Jan D.'s message of "Sun, 27 Feb 2005 21:35:13 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33887 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33887 "Jan D." writes: >> "Jan D." writes: >> >>> If you configured with GTK, there is a possibility that multiple >>> threads are updating interrupt_input_block. I've tried to handle that >>> situation, but bugs may of course still remain. >> >> How did you try to handle it? >> >> There must only be one thread touching interrupt_input_blocked, or >> we get into trouble. >> >> Could you elaborate on what happens here in parallel threads? I >> can't imagine that one can execute Lisp sanely in two threads, so >> one thread would be likely C-only? Why would that thread have to >> meddle with interrupt_input_blocked at all? > > The GTK file dialog can load different backends (Gnome has one) that > may add or alter the behaviour of the file dialog. The Gnome > backend creates several threads (the default GTK backend does not). > This is not a problem, except when a signal (i.e. real Unix signal) > is caught by Emacs. The signal may be caught by one of the Gnome > threads and it would then execute the X event loop. This situation > leads to two threads accessing variables and a crash usually occurs > (perhaps a bit later). > > The fix is basically to keep track of what thread id the Emacs main > thread has, and if a signal handler is called by another thread id, > the signal is delivered to the main thread and nothing more is done > in the signal handler. This sounds like normally only the main thread should ever be touching interrupt_input_blocked, unless we have a bug. Correct? So we need not think about how to synchronize accesses to the variable, but rather make sure that no thread except the main thread will ever run code touching it. Correct? A use of BLOCK_INPUT or UNBLOCK_INPUT outside of the main thread is a bug. Correct? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum