From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#453: 23.0.60; rfc822-bad-address: wrong-type-argument error Date: Fri, 20 Jun 2008 17:34:40 +0200 Message-ID: <873an8p1bj.fsf@escher.local.home> Reply-To: Stephen Berman , 453@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1213976847 21160 80.91.229.12 (20 Jun 2008 15:47:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2008 15:47:27 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 17:48:11 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 1K9iqQ-0003vr-Hd for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2008 17:48:10 +0200 Original-Received: from localhost ([127.0.0.1]:45970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9ipb-0004ZR-Jb for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2008 11:47:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K9ipV-0004Xt-JF for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 11:47:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K9ipU-0004XB-Ub for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 11:47:13 -0400 Original-Received: from [199.232.76.173] (port=58997 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9ipU-0004Wl-K3 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 11:47:12 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38244) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K9ipT-0008BV-NX for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2008 11:47:12 -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 m5KFl9xi000721; Fri, 20 Jun 2008 08:47:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m5KFe5GG031011; Fri, 20 Jun 2008 08:40:05 -0700 X-Loop: don@donarmstrong.com Resent-From: Stephen Berman Original-Sender: steve@escher.local.home Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 20 Jun 2008 15:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 453 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121397610229691 (code B ref -1); Fri, 20 Jun 2008 15:40:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 20 Jun 2008 15:35:02 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5KFYsTx029681 for ; Fri, 20 Jun 2008 08:34:56 -0700 Original-Received: from mail.gnu.org ([199.232.76.166]:46526 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1K9idY-0003tg-7R for emacs-pretest-bug@gnu.org; Fri, 20 Jun 2008 11:34:52 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1K9idU-0008Vk-KD for emacs-pretest-bug@gnu.org; Fri, 20 Jun 2008 11:34:52 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:56922) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1K9idS-0008S8-OQ for emacs-pretest-bug@gnu.org; Fri, 20 Jun 2008 11:34:48 -0400 Original-Received: (qmail invoked by alias); 20 Jun 2008 15:34:41 -0000 Original-Received: from i5387E080.versanet.de (EHLO escher.local.home) [83.135.224.128] by mail.gmx.net (mp057) with SMTP; 20 Jun 2008 17:34:41 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1+O7WAg5FWOWeLR93yozIvhteyjd1kphO1sr8vwUQ 6bQLMi5cUnuVpo Original-Received: by escher.local.home (Postfix, from userid 1000) id 742341D0E50; Fri, 20 Jun 2008 17:34:39 +0200 (CEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Fri, 20 Jun 2008 11:47:13 -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:18465 gmane.emacs.pretest.bugs:22659 Archived-At: --=-=-= I was reading a newsgroup with Gnus, typed `n' (gnus-summary-next-unread-article) to read the next article[1], and got a wrong-type-argument error. The backtrace is attached. The error occurs in rfc822-bad-address, when the first argument of narrow-to-region, rfc822-address-start, is nil. The value is nil at this point because rfc822-addresses calls rfc822-nuke-whitespace before rfc822-address-start is assigned an initial value. Simply assigning an initial non-nil in the let declaration does not work, because then rfc822-bad-address tries to throw to 'address, but the corresponding catch in rfc822-addresses has not yet been established -- that happens after the call to rfc822-nuke-whitespace. I tried moving the catch above the rfc822-nuke-whitespace call: in combination with an initial value for rfc822-address-start, this allows rfc822-bad-address to return an error string to rfc822-addresses -- see the patch below --, but the caller in my setup, bbdb-rfc822-addresses, expects a list, so this raises another wrong-type-argument error. If it is legitimate for rfc822-bad-address to return a non-list value in this case, then the bug is presumably in bbdb-rfc822-addresses (from bbdb-snarf.el, not part of Emacs); but I don't know if this is the right diagnosis. If it is, I'll report it to the BBDB list, and the patch below, or a better one, should be applied to rfc822.el. Steve Berman --=-=-= Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Description: backtrace Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) narrow-to-region(nil 5) (save-restriction (insert "_^_") (narrow-to-region rfc822-address-start (if ... ... ...)) (let (...) (while losers ... ... ...)) (goto-char (point-min)) (insert "(Unparsable address -- " reason ": \"") (goto-char (point-max)) (insert "\")")) rfc822-bad-address("Unbalanced comment (...)") (if (eobp) (rfc822-bad-address "Unbalanced comment (...)") (/= (setq ch ...) 41)) (while (if (eobp) (rfc822-bad-address "Unbalanced comment (...)") (/= ... 41)) (cond (... ...) (... ...) (... ...) (t ...))) (cond ((eobp) nil) ((= ... 40) (forward-char 1) (while ... ...) (forward-char -1) (delete-char 2) t) ((memq ch ...) (delete-region ... ...) t) (t nil)) (while (cond (... nil) (... ... ... ... ... t) (... ... t) (t nil))) (let (ch) (while (cond ... ... ... ...)) (or (not leave-space) (eobp) (bobp) (= ... 32) (insert 32))) rfc822-nuke-whitespace() (let ((list nil) tem rfc822-address-start) (rfc822-nuke-whitespace) (while (not ...) (setq rfc822-address-start ...) (setq tem ...) (cond ... ... ...)) (nreverse list)) (save-excursion (set-buffer buf) (make-local-variable (quote case-fold-search)) (setq case-fold-search nil) (insert header-text) (goto-char (point-min)) (while (re-search-forward "\\([^\\]\\(\\\\\\\\\\)*\\)\n[ ]" nil t) (replace-match "\\1 " t)) (goto-char (point-min)) (let (... tem rfc822-address-start) (rfc822-nuke-whitespace) (while ... ... ... ...) (nreverse list))) (unwind-protect (save-excursion (set-buffer buf) (make-local-variable ...) (setq case-fold-search nil) (insert header-text) (goto-char ...) (while ... ...) (goto-char ...) (let ... ... ... ...)) (and buf (kill-buffer buf))) (let ((buf ...)) (unwind-protect (save-excursion ... ... ... ... ... ... ... ...) (and buf ...))) (if (string-match "\\`[ ]*\\([^][ rfc822-addresses("(\"\"Gro\x00df") (let* ((thisaddr ...) (comma ...) (parsed ...)) (if (string-match "(" ...) (setq start comma) (setq addrs ... addrline ... start 0))) (while (string-match "\\([^,]+\\)," addrline start) (let* (... ... ...) (if ... ... ...))) (let (addrs (start 0)) (setq addrline (concat addrline ",")) (while (string-match "\\([^,]+\\)," addrline start) (let* ... ...)) addrs) bbdb-rfc822-addresses("(\"\"Gro\x00df, Werner\"\") ") bbdb-get-addresses(nil "stephen\\.berman@gmx\\.net" gnus-fetch-field) bbdb/gnus-update-records(nil) bbdb/gnus-pop-up-bbdb-buffer() run-hooks(gnus-article-prepare-hook) apply(run-hooks gnus-article-prepare-hook) gnus-run-hooks(gnus-article-prepare-hook) gnus-article-prepare-display() gnus-article-prepare(166195 nil) gnus-summary-display-article(166195) gnus-summary-next-article(t nil) gnus-summary-next-unread-article() call-interactively(gnus-summary-next-unread-article nil nil) --=-=-= *** emacs/lisp/mail/rfc822.el.~1.28.~ 2008-05-06 17:54:09.000000000 +0200 --- emacs/lisp/mail/rfc822.el 2008-06-20 17:16:10.000000000 +0200 *************** *** 278,319 **** (list (substring header-text (match-beginning 1) (match-end 1))) (let ((buf (generate-new-buffer " rfc822"))) (unwind-protect ! (save-excursion ! (set-buffer buf) ! (make-local-variable 'case-fold-search) ! (setq case-fold-search nil) ;For speed(?) ! (insert header-text) ! ;; unfold continuation lines ! (goto-char (point-min)) ! (while (re-search-forward "\\([^\\]\\(\\\\\\\\\\)*\\)\n[ \t]" nil t) ! (replace-match "\\1 " t)) ! (goto-char (point-min)) ! (let ((list ()) ! tem ! rfc822-address-start); this is for rfc822-bad-address ! (rfc822-nuke-whitespace) ! (while (not (eobp)) ! (setq rfc822-address-start (point)) ! (setq tem ! (catch 'address ; this is for rfc822-bad-address ! (cond ((rfc822-looking-at ?\,) ! nil) ! ((looking-at "[][\000-\037@;:\\.>)]") ! (forward-char) ! (rfc822-bad-address ! (format "Strange character \\%c found" ! (preceding-char)))) ! (t ! (rfc822-addresses-1 t))))) ! (cond ((null tem)) ! ((stringp tem) ! (setq list (cons tem list))) ! (t ! (setq list (nconc (nreverse tem) list))))) ! (nreverse list))) ! (and buf (kill-buffer buf)))))) (provide 'rfc822) --- 278,322 ---- (list (substring header-text (match-beginning 1) (match-end 1))) (let ((buf (generate-new-buffer " rfc822"))) (unwind-protect ! (save-excursion ! (set-buffer buf) ! (make-local-variable 'case-fold-search) ! (setq case-fold-search nil) ;For speed(?) ! (insert header-text) ! ;; unfold continuation lines ! (goto-char (point-min)) ! (while (re-search-forward "\\([^\\]\\(\\\\\\\\\\)*\\)\n[ \t]" nil t) ! (replace-match "\\1 " t)) ! (goto-char (point-min)) ! (let ((list ()) ! tem ! ;; This is for rfc822-bad-address. Give it a non-nil initial ! ;; value to prevent rfc822-bad-address from raising a ! ;; wrong-type-argument error ! (rfc822-address-start (point))) ! (catch 'address ; this is for rfc822-bad-address ! (rfc822-nuke-whitespace) ! (while (not (eobp)) ! (setq rfc822-address-start (point)) ! (setq tem ! (cond ((rfc822-looking-at ?\,) ! nil) ! ((looking-at "[][\000-\037@;:\\.>)]") ! (forward-char) ! (rfc822-bad-address ! (format "Strange character \\%c found" ! (preceding-char)))) ! (t ! (rfc822-addresses-1 t)))) ! (cond ((null tem)) ! ((stringp tem) ! (setq list (cons tem list))) ! (t ! (setq list (nconc (nreverse tem) list))))) ! (nreverse list)))) ! (and buf (kill-buffer buf)))))) (provide 'rfc822) In GNU Emacs 23.0.60.3 (i686-pc-linux-gnu, GTK+ Version 2.12.0) of 2008-06-16 on escher Windowing system distributor `The X.Org Foundation', version 11.0.70200000 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: @im=local locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Debugger Minor modes in effect: shell-dirtrack-mode: t show-paren-mode: t recentf-mode: t tabbar-mwheel-mode: t tabbar-mode: t display-time-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x o C-c j l i s C-u C-M-x C-c j s u m n C-x b SPC r f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f C-x b SPC r C-x b a C-y C-x b SPC r C-a SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC i SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC q t h M-u C-x b l i s C-g C-x b r C-M-x C-M-y C-M-x C-x b * S u n C-x b r C-s C-w C-w C-w C-s C-s C-s C-s C-s C-s C-s C-M-a M-< C-c j d M-x g u C-x b r C-x d C-g C-x b M-x r e p o r b C-c j C-c j e l i s C-x b M-x r e p o r b Recent messages: Auto-saving...done Mark saved where search started Mark set Auto-saving...done Mark set Auto-saving...done Quit Making completion list... byte-code: Command attempted to use minibuffer while in minibuffer Making completion list... Footnotes: [1] This is the article: --=-=-=--