From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 19 13:53:54 2011 Received: (at submit) by debbugs.gnu.org; 19 Mar 2011 17:53:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q10LY-0004FX-Ov for submit@debbugs.gnu.org; Sat, 19 Mar 2011 13:53:54 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0ye7-0001u9-EA for submit@debbugs.gnu.org; Sat, 19 Mar 2011 12:04:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0ye0-0002w3-Bt for submit@debbugs.gnu.org; Sat, 19 Mar 2011 12:04:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:42128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0ydz-0002v2-AZ for submit@debbugs.gnu.org; Sat, 19 Mar 2011 12:04:48 -0400 Received: from [140.186.70.92] (port=51291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0ydm-00039X-04 for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2011 12:04:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0ydg-0002lq-Cl for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2011 12:04:30 -0400 Received: from tamar.safe-mail.net ([213.8.161.229]:54722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0ydf-0002kC-Vc for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2011 12:04:28 -0400 Received: by tamar.safe-mail.net with Safe-mail (Exim 4.66) (envelope-from ) id 1Q0ydS-0005na-Mg for bug-gnu-emacs@gnu.org; Sat, 19 Mar 2011 12:04:14 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=N1-0105; d=Safe-mail.net; b=iBD9zcKQboX2owPVd/n5YEBsEF3NQHf/foHHrOjU8Wqk+UyuZIw6qNApNlNmGKC1 I7D+HR/UKlXHeTazK97FHFFEYWR1Qq8pqRSqUx8HJt+TegGjyiQ3su4QIwqDSowR 8TufNaHPh4w4WJyYdCvobaVSe1csVOGqkGZsJe7kvM4=; Received: from pc ([92.201.10.74]) by Safe-mail.net with https Subject: mpc.el: "error in process filter" Date: Sat, 19 Mar 2011 12:04:14 -0400 From: axel.junker@Safe-mail.net To: bug-gnu-emacs@gnu.org X-SMType: Regular X-SMRef: N1B-W7DCLzv2F4 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SMSignature: i5aE/MJdYnjD95GXF2WiAsaGG/YBw1Xf96eakDTAGHqS20n8+nkzLy8tNi9xBsS6 yBk+JiMk4EiiTiWm1xDAugONwHFAd/ThqjD4Tuz/eZij6E/WsVCajDqlAcBEtkgQ bJY9gP3pP1Imp2EiUunm7b5dglVsIDsfuF8O9Ha75sE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 19 Mar 2011 13:53:51 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) I am using a semi-fresh build of emacs master on i686-pc-linux-gnu. This is a bug report concerning mpc.el. I have not modifier mpc.el or its variables so far. When selecting an album in the "Albums | Playlists"-view (upper right corner), mpc.el issues a find command regarding Albums and Playlists E.g. for an Album called 2001: Send "(find Album 2001)" Receive "file: dr. dre - 2001/Dr. Dre - Lolo.mp3 Time: 42 Artist: Dr. Dre Title: Lolo [etc.] file: dr. dre - 2001/Dr. Dre - Bang Bang.mp3 Time: 222 Artist: Dr. Dre Title: Bang Bang Album: 2001 Track: 21 Genre: Hip-Hop OK " Send "(listplaylistinfo 2001)" Receive "ACK [50@0] {listplaylistinfo} No such playlist " mpc--proc-filter regards "ACK [50@0] {listplaylistinfo} No such playlist" to be an error and signals an mpc-proc-error. In mpc-cmd-find (mpc.el:599) the mpc-proc-cmd that issues that listplaylistinfo-request explicitly ignores any error by wrapping the invocation in a condition-case with a nil error handler. Unfortunately this does not work. As the error is signaled by a process filter, emacs itself issues an error in process.c . That means, the signal never escapes the process filter. This leads to an ugly error output and the album selection does not work at all. I think this is a bug. /-Axel In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.22.0) of 2011-03-03 on ghost Windowing system distributor `The X.Org Foundation', version 11.0.10900000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Recent messages: error in process filter: mpc--proc-filter: MPD error error in process filter: MPD error From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 07 14:04:24 2011 Received: (at control) by debbugs.gnu.org; 7 Jul 2011 18:04:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qesw4-0000ea-BG for submit@debbugs.gnu.org; Thu, 07 Jul 2011 14:04:24 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qesw1-0000eO-OM for control@debbugs.gnu.org; Thu, 07 Jul 2011 14:04:22 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p67I4FNo006976; Thu, 7 Jul 2011 14:04:15 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 51503B4177; Thu, 7 Jul 2011 14:04:15 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: bug#8293: mpc.el: "error in process filter" Message-ID: References: Date: Thu, 07 Jul 2011 14:04:15 -0400 In-Reply-To: (axel junker's message of "Sat, 19 Mar 2011 12:04:14 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV3911=0 X-NAI-Spam-Version: 2.2.0.9286 : core <3911> : streams <658522> : uri <909000> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) severity 8293 important thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 23 21:58:09 2011 Received: (at 8293) by debbugs.gnu.org; 24 Aug 2011 01:58:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qw2jI-0008OM-0r for submit@debbugs.gnu.org; Tue, 23 Aug 2011 21:58:09 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qw2jF-0008OA-DD for 8293@debbugs.gnu.org; Tue, 23 Aug 2011 21:58:06 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAOlYVE5Ld+HZ/2dsb2JhbABCp2l4gUABAQQBJy8jBQsLNBIUGA2IKLwghkgEn3eEOA X-IronPort-AV: E=Sophos;i="4.68,273,1312171200"; d="scan'208";a="132490277" Received: from 75-119-225-217.dsl.teksavvy.com (HELO ceviche.home) ([75.119.225.217]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 23 Aug 2011 21:55:33 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 57E716610A; Tue, 23 Aug 2011 21:55:33 -0400 (EDT) From: Stefan Monnier To: axel.junker@Safe-mail.net Subject: Re: mpc.el: "error in process filter" Message-ID: References: Date: Tue, 23 Aug 2011 21:55:33 -0400 In-Reply-To: (axel junker's message of "Sat, 19 Mar 2011 12:04:14 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 8293 Cc: 8293@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > I am using a semi-fresh build of Emacs master on > i686-pc-linux-gnu. This is a bug report concerning mpc.el. I have not > modifier mpc.el or its variables so far. > When selecting an album in the "Albums | Playlists"-view (upper right > corner), mpc.el issues a find command regarding Albums and Playlists > E.g. for an Album called 2001: > Send "(find Album 2001)" > Receive "file: dr. dre - 2001/Dr. Dre - Lolo.mp3 > Time: 42 > Artist: Dr. Dre > Title: Lolo > [etc.] > file: dr. dre - 2001/Dr. Dre - Bang Bang.mp3 > Time: 222 > Artist: Dr. Dre > Title: Bang Bang > Album: 2001 > Track: 21 > Genre: Hip-Hop > OK > " > Send "(listplaylistinfo 2001)" > Receive "ACK [50@0] {listplaylistinfo} No such playlist > " > mpc--proc-filter regards "ACK [50@0] {listplaylistinfo} No such > playlist" to be an error and signals an mpc-proc-error. > In mpc-cmd-find (mpc.el:599) the mpc-proc-cmd that issues that > listplaylistinfo-request explicitly ignores any error by wrapping the > invocation in a condition-case with a nil error handler. > Unfortunately this does not work. As the error is signaled by > a process filter, emacs itself issues an error in process.c . That > means, the signal never escapes the process filter. This leads to an > ugly error output and the album selection does not work at all. [...] > Recent messages: > error in process filter: mpc--proc-filter: MPD error > error in process filter: MPD error Hmm... it turns out that errors in process filters are handled differently depending on debug-on-error (i.e. they're not caught specially if debug-on-error is non-nil) so the above problem did not show up in my use since I always set debug-on-error. I think this indicates a problem in error handling of filters (read_process_output should not catch errors if it's called by accept-process-output), but since I'm not going to change this behavior now, I installed the change below instead, which turns the filter error into a process property which is turned into an error by the surrounding code (the one that calls accept-process-output). It seems to fix your immediate problem, tho it may introduce other problems (in code that fails to check this new property). Can you confirm your original problem is now fixed (album selection still worked somehow in my tests, despite the error you pointed out)? Stefan === modified file 'lisp/mpc.el' --- lisp/mpc.el 2011-06-02 11:24:12 +0000 +++ lisp/mpc.el 2011-08-24 01:42:56 +0000 @@ -246,11 +246,12 @@ (process-put proc 'ready t) (unless (eq (match-end 0) (point-max)) (error "Unexpected trailing text")) - (let ((error (match-string 1))) + (let ((error-text (match-string 1))) (delete-region (point) (point-max)) (let ((callback (process-get proc 'callback))) (process-put proc 'callback nil) - (if error (signal 'mpc-proc-error error)) + (if error-text + (process-put proc 'mpc-proc-error error-text)) (funcall callback))))))))) (defun mpc--proc-connect (host) @@ -314,19 +315,23 @@ mpc-proc) (setq mpc-proc (mpc--proc-connect mpc-host)))) +(defun mpc-proc-check (proc) + (let ((error-text (process-get proc 'mpc-proc-error))) + (when error-text + (process-put proc 'mpc-proc-error nil) + (signal 'mpc-proc-error error-text)))) + (defun mpc-proc-sync (&optional proc) "Wait for MPC process until it is idle again. Return the buffer in which the process is/was running." (unless proc (setq proc (mpc-proc))) (unwind-protect - (condition-case err (progn (while (and (not (process-get proc 'ready)) (accept-process-output proc))) + (mpc-proc-check proc) (if (process-get proc 'ready) (process-buffer proc) - ;; (delete-process proc) (error "No response from MPD"))) - (error (message "MPC: %s" err) (signal (car err) (cdr err)))) (unless (process-get proc 'ready) ;; (debug) (message "Killing hung process") === modified file 'src/process.c' --- src/process.c 2011-08-18 15:33:22 +0000 +++ src/process.c 2011-08-24 01:50:01 +0000 @@ -5186,6 +5186,9 @@ p->decoding_carryover = coding->carryover_bytes; } if (SBYTES (text) > 0) + /* FIXME: It's wrong to wrap or not based on debug-on-error, and + sometimes it's simply wrong to wrap (e.g. when called from + accept-process-output). */ internal_condition_case_1 (read_process_output_call, Fcons (outstream, Fcons (proc, Fcons (text, Qnil))), From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 08:28:50 2012 Received: (at 8293-done) by debbugs.gnu.org; 8 Jan 2012 13:28:50 +0000 Received: from localhost ([127.0.0.1]:49664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rjsnq-0005aM-7G for submit@debbugs.gnu.org; Sun, 08 Jan 2012 08:28:50 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:38844) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rjsno-0005aE-7p for 8293-done@debbugs.gnu.org; Sun, 08 Jan 2012 08:28:49 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q08DSbnm029309; Sun, 8 Jan 2012 08:28:37 -0500 Received: by pastel.home (Postfix, from userid 20848) id 6B5D158F7E; Sun, 8 Jan 2012 08:28:36 -0500 (EST) From: Stefan Monnier To: Chong Yidong Subject: Re: Bug#8293 Message-ID: References: <87zke0kp3p.fsf@gnu.org> Date: Sun, 08 Jan 2012 08:28:36 -0500 In-Reply-To: <87zke0kp3p.fsf@gnu.org> (Chong Yidong's message of "Sat, 07 Jan 2012 14:23:38 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4094=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4094> : streams <717871> : uri <1042971> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 8293-done Cc: 8293-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > Could you commit your patch for Bug#8293 and close the bug? Thanks. I committed it back when I posted it, Stefan From unknown Sat Aug 09 01:09:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 06 Feb 2012 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator