From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: emacs gets stuck in wait_reading_process_output sometimes Date: Wed, 11 Jun 2008 21:09:34 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1213211403 12248 80.91.229.12 (11 Jun 2008 19:10:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 19:10:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 11 21:10:45 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K6ViP-0005Qp-9F for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 21:10:37 +0200 Original-Received: from localhost ([127.0.0.1]:41346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Vhb-0002rR-Og for ged-emacs-devel@m.gmane.org; Wed, 11 Jun 2008 15:09:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6VhX-0002oX-8S for emacs-devel@gnu.org; Wed, 11 Jun 2008 15:09:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6VhV-0002lv-KK for emacs-devel@gnu.org; Wed, 11 Jun 2008 15:09:42 -0400 Original-Received: from [199.232.76.173] (port=54804 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6VhV-0002lk-Fl for emacs-devel@gnu.org; Wed, 11 Jun 2008 15:09:41 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:36144 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K6VhV-0005H3-HF for emacs-devel@gnu.org; Wed, 11 Jun 2008 15:09:41 -0400 Original-Received: from chopper (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id m5BJ9Yln015647 for ; Wed, 11 Jun 2008 21:09:35 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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 Xref: news.gmane.org gmane.emacs.devel:98972 Archived-At: #0 0x00110422 in __kernel_vsyscall () #1 0x00cb85bd in ___newselect_nocancel () from /lib/libc.so.6 #2 0x081adc25 in select_wrapper (n=-514, rfd=0x0, wfd=0xbfd5a178, xfd=0x0, tmo=0xbfd5a2a8) at process.c:4204 #3 0x081b0e3f in wait_reading_process_output (time_limit=0, microsecs=10000, read_kbd=0, do_display=0, wait_for_cell=137764129, wait_proc=0xb819ca0, just_wait_proc=0) at process.c:4587 #4 0x081b2de7 in Faccept_process_output (process=193043620, seconds=0, millisec=80, just_this_one=137764129) at process.c:3946 This only happens sometimes. I have a small elisp wrapper for fetchmail, and I think the stuckness might happen when fetchmail exits, but I'm not sure. Any hints how to debug this better when it happens? ;jvfetchmail.el ; ;jvfetchmail calls fetchmail. After fetchmail is run, gnus is updated. ; ;my particular mail setup looks like this: ; - get mail via imap with fetchmail ; - filter mail with sieve, using dovecot local delivery agent ; - read mail using gnus from a local dovecot imapd instance on my laptop ;this looks complicated but is surprisingly efficient ; ;jvfetchmail also tries to help you not to obsess over email. ; ;jvfetchmail was only tested on emacs 23 ;joakim@verona.se ;call fetchmail and stuff (defvar jvfetchmail-last-called nil "when jvfetvhmail was last called") (defvar jvfetchmail-in-progress nil) ;TODO process might fail, reset "in-progress" flag ;TODO gnus might fail at end, reset "in-progress" flag ;TODO some way of resetting the flag (provide 'jvfetchmail) (defun jvfetchmail-sentinel (process event) (setq jvfetchmail-in-progress nil) ;should rather be called lat but currently gnus might fail (let* ((msg (format "fetchmail %s" event))) (save-excursion (set-buffer (get-buffer-create "*fetchmail*")) (gnus-group-get-new-news) (insert msg)) (princ msg))) ;if no mail : exited abnormally with code 1 ;otherwise: finished (defun jvfetchmail () "run fetchmail and stuff" (interactive) (if jvfetchmail-in-progress (message "jvfetchmail is running already, dont be obsessive") (progn (if jvfetchmail-last-called (progn (message "jvfetchmail last called %s, %s minutes ago" (format-time-string "%H:%M" jvfetchmail-last-called) (round (/ (float-time (time-subtract (current-time) jvfetchmail-last-called)) 60)))) (message "jvfetchmail 1st run this session")) (setq jvfetchmail-last-called (current-time)) (setq jvfetchmail-in-progress t) (save-excursion (set-buffer (get-buffer-create "*jvfetchmail*")) (erase-buffer ) (let* ((fetchmail-process (start-process "fetchmail" "*jvfetchmail*" "fetchmail"))) (set-process-sentinel fetchmail-process 'jvfetchmail-sentinel) ) ) ) )) (global-set-key (kbd " m") 'jvfetchmail) -- Joakim Verona