From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#84: Acknowledgement (23.0.60; Occasional hangs in flyspell-mode and ispell-word) Date: Sat, 12 Jul 2008 17:56:41 +0200 Message-ID: References: <20080327052040.002826434E0@mt-computer.local> Reply-To: Markus Triska , 84@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1215878919 25518 80.91.229.12 (12 Jul 2008 16:08:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Jul 2008 16:08:39 +0000 (UTC) To: 84@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 12 18:09:26 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KHhez-00049v-58 for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Jul 2008 18:09:21 +0200 Original-Received: from localhost ([127.0.0.1]:58276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KHhe7-0006oO-BV for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Jul 2008 12:08:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KHhd2-0006Mr-1b for bug-gnu-emacs@gnu.org; Sat, 12 Jul 2008 12:07:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KHhd0-0006M5-9M for bug-gnu-emacs@gnu.org; Sat, 12 Jul 2008 12:07:19 -0400 Original-Received: from [199.232.76.173] (port=58256 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KHhd0-0006Ly-3S for bug-gnu-emacs@gnu.org; Sat, 12 Jul 2008 12:07:18 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:58887) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KHhcz-0006ot-Kw for bug-gnu-emacs@gnu.org; Sat, 12 Jul 2008 12:07:17 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6CG7FmB021461; Sat, 12 Jul 2008 09:07:15 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6CG56x7020400; Sat, 12 Jul 2008 09:05:06 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Triska Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 12 Jul 2008 16:05:06 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 84 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Original-Received: via spool by 84-submit@emacsbugs.donarmstrong.com id=B84.121587822918377 (code B ref 84); Sat, 12 Jul 2008 16:05:06 +0000 Original-Received: (at 84) by emacsbugs.donarmstrong.com; 12 Jul 2008 15:57:09 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m6CFv4qq018371 for <84@emacsbugs.donarmstrong.com>; Sat, 12 Jul 2008 08:57:06 -0700 Original-Received: (qmail invoked by alias); 12 Jul 2008 15:56:57 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp005) with SMTP; 12 Jul 2008 17:56:57 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/8R2VZfNv8x8EGytZoqU4tJdg+9bMNEW1dYj2Ub0 pgqFT90Ru5f59E Original-Received: by mt-computer.local (Postfix, from userid 502) id 891A79518EA; Sat, 12 Jul 2008 17:56:41 +0200 (CEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (darwin) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Sat, 12 Jul 2008 12:07:19 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18707 Archived-At: I now think the previous patch only fixes a symptom of an underlying problem, which is that the aspell process occasionally receives SIGPIPE and terminates unexpectedly. Here's a simpler test case - it seems to work only on OSX and with Emacs >= 23, but I have seen very similar problems on other systems and with Emacs <= 22 too (for example, when replying to a post in Gnus, sometimes aspell would die and not be restarted). Let f.el consist of: (defun reactivate-flyspell () (unless (memq 'flyspell-post-command-hook post-command-hook) (flyspell-mode 1))) (setq my-idle (run-with-idle-timer 0.1 t 'reactivate-flyspell)) If I then do: 1) $ emacs -Q f.el -f eval-buffer 2) enter and leave Gnus twice: M-x gnus RET q y M-x gnus RET q y 3) kill the aspell process: M-! killall -9 aspell RET (aspell is instantly restarted by the idle timer, and you can attach gdb to the new process to verify the signal in the next step.) 4) M-x gnus RET q y (==> you're back in f.el - do anything, like C-n) Now aspell receives SIGPIPE and exits, and I get EBADF in wait_reading_process_output; the previous patch handles this, and thus you can at least interrupt the wait. Ideally though, the aspell process would not have been killed in the first place, and besides, after SIGPIPE, the process status should become 'signal eventually. I would like to trace down where the SIGPIPE comes from, and how the file descriptor can become invalid in Emacs; I've traced through the Lisp code of Gnus and flyspell/ispell, and they seem not to touch the aspell process here. What would be a good place to put a breakpoint in GDB, such that I can observe execution right after the final "C-n" in f.el? I tried to raise an error in before-change-functions in f.el, and instead of "C-n" insert a character in the last step, so that I can put a breakpoint in Fsignal, but the SIGPIPE occurs before this hook.