From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Kim Newsgroups: gmane.emacs.bugs Subject: bug#8998: 24.0.50; expand-abbrev goes into infinite loop Date: Mon, 04 Jul 2011 17:47:36 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309826905 22460 80.91.229.12 (5 Jul 2011 00:48:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2011 00:48:25 +0000 (UTC) To: 8998@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 05 02:48:21 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdtoK-0007qr-Oz for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jul 2011 02:48:21 +0200 Original-Received: from localhost ([::1]:40267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdtoJ-0004BE-RP for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Jul 2011 20:48:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdto4-0004B9-7U for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:48:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdto2-00025r-EX for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:48:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdto2-00025m-CI for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qdto2-0005uf-5B; Mon, 04 Jul 2011 20:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Kim Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jul 2011 00:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.130982687522711 (code B ref -1); Tue, 05 Jul 2011 00:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jul 2011 00:47:55 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdtnu-0005uG-2I for submit@debbugs.gnu.org; Mon, 04 Jul 2011 20:47:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qdtnr-0005u4-Kd for submit@debbugs.gnu.org; Mon, 04 Jul 2011 20:47:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdtnk-00024h-9Q for submit@debbugs.gnu.org; Mon, 04 Jul 2011 20:47:46 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:40717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdtnk-00024c-7s for submit@debbugs.gnu.org; Mon, 04 Jul 2011 20:47:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdtni-0004Ax-A3 for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:47:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdtng-00024B-7y for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:47:42 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:50527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdtnf-000243-Rj for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2011 20:47:40 -0400 Original-Received: by pzk4 with SMTP id 4so2064004pzk.0 for ; Mon, 04 Jul 2011 17:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=k2vBz0saU8C/ht2FxgWjY+vmXpPRdpCE4PsjxNCI1go=; b=VXslboqHxtDLOuxtSRZYa6tOzWeidF54vq4ii7kYNuxjeRkuEGuIIbUSLk4JxrISMk A/DGh6utx+PNBpTFyN43cFjsl2mmgCdV8bNMoz/sdTd7biNzZJ7PZwNOxgk0iv6cFakz EUwqCPPSkIV5KM4qppfc/Kmowx5RNTOJfdErw= Original-Received: by 10.68.48.106 with SMTP id k10mr247296pbn.214.1309826858247; Mon, 04 Jul 2011 17:47:38 -0700 (PDT) Original-Received: from kimr-laptop (static-50-53-5-59.bvtn.or.frontiernet.net [50.53.5.59]) by mx.google.com with ESMTPS id x2sm4174911pbn.45.2011.07.04.17.47.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 17:47:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 04 Jul 2011 20:48:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:48001 Archived-At: This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgement at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': Abbreviation mode seems to be busted, because turning it on results in emacs going into infinite loop. To see the problem, start emacs-24 (latest bzr version I tested was 104955 dated July 4, 2011) like this emacs24 -q -l abbrev-bug.el where the content of abbrev-bug.el is (setq debug-on-quit t) ;; Load abbrev.el rather than use abbrev.elc, so as to get ;; more useful stack trace. (load-library "abbrev.el") (switch-to-buffer "*scratch*") (abbrev-mode 1) (insert "a") (expand-abbrev) This seems to put emacs into infinite loop, so hit Control-g to take control which results in the stack trace shown below. Emacs 24 bzr version 104562 dated June 11, 2011 does not suffer this problem, so it seems to have been introduced within the past three weeks between June 11 and July 4. Debugger entered--Lisp error: (quit) (and tables (not (symbol-value sym))) (while (and tables (not (symbol-value sym))) (let* ((table (pop tables)) (case-fold (not (abbrev-table-get table :case-fixed)))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq sym (or (intern-soft abbrev table) (when case-fold (let ((sym ...)) (and sym (not ...) sym))))))) (let ((tables (abbrev--active-tables table)) sym) (while (and tables (not (symbol-value sym))) (let* ((table (pop tables)) (case-fold (not (abbrev-table-get table :case-fixed)))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq sym (or (intern-soft abbrev table) (when case-fold (let (...) (and sym ... sym))))))) (if (symbol-value sym) sym)) abbrev-symbol(#("a" 0 1 (fontified nil)) [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...]) (let ((abbrev (abbrev-symbol name table))) (when abbrev (setq enable-fun (abbrev-get abbrev :enable-function)) (and (or (not enable-fun) (funcall enable-fun)) (list abbrev name start end)))) (and (or (not enable-fun) (funcall enable-fun)) (let ((re (abbrev-table-get table :regexp))) (if (null re) (let ((lim (point))) (backward-word 1) (setq start (point)) (forward-word 1) (setq end (min (point) lim))) (when (looking-back re (line-beginning-position)) (setq start (match-beginning 1)) (setq end (match-end 1))))) (setq name (buffer-substring start end)) (let ((abbrev (abbrev-symbol name table))) (when abbrev (setq enable-fun (abbrev-get abbrev :enable-function)) (and (or (not enable-fun) (funcall enable-fun)) (list abbrev name start end))))) (setq res (and (or (not enable-fun) (funcall enable-fun)) (let ((re (abbrev-table-get table :regexp))) (if (null re) (let ((lim (point))) (backward-word 1) (setq start (point)) (forward-word 1) (setq end (min (point) lim))) (when (looking-back re (line-beginning-position)) (setq start (match-beginning 1)) (setq end (match-end 1))))) (setq name (buffer-substring start end)) (let ((abbrev (abbrev-symbol name table))) (when abbrev (setq enable-fun (abbrev-get abbrev :enable-function)) (and (or (not enable-fun) (funcall enable-fun)) (list abbrev name start end)))))) (let* ((table (pop tables)) (enable-fun (abbrev-table-get table :enable-function))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq res (and (or (not enable-fun) (funcall enable-fun)) (let ((re (abbrev-table-get table :regexp))) (if (null re) (let ((lim ...)) (backward-word 1) (setq start (point)) (forward-word 1) (setq end (min ... lim))) (when (looking-back re (line-beginning-position)) (setq start (match-beginning 1)) (setq end (match-end 1))))) (setq name (buffer-substring start end)) (let ((abbrev (abbrev-symbol name table))) (when abbrev (setq enable-fun (abbrev-get abbrev :enable-function)) (and (or (not enable-fun) (funcall enable-fun)) (list abbrev name start end)))))) (goto-char pos)) (while (and tables (not (car res))) (let* ((table (pop tables)) (enable-fun (abbrev-table-get table :enable-function))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq res (and (or (not enable-fun) (funcall enable-fun)) (let ((re (abbrev-table-get table :regexp))) (if (null re) (let (...) (backward-word 1) (setq start ...) (forward-word 1) (setq end ...)) (when (looking-back re ...) (setq start ...) (setq end ...)))) (setq name (buffer-substring start end)) (let ((abbrev (abbrev-symbol name table))) (when abbrev (setq enable-fun (abbrev-get abbrev :enable-function)) (and (or ... ...) (list abbrev name start end)))))) (goto-char pos))) (if abbrev-start-location (progn (setq start abbrev-start-location) (setq abbrev-start-location nil) (if (and (< start (point-max)) (eq (char-after start) 45)) (delete-region start (1+ start))) (skip-syntax-backward " ") (setq end (point)) (when (> end start) (setq name (buffer-substring start end)) (goto-char pos) (list (abbrev-symbol name tables) name start end))) (while (and tables (not (car res))) (let* ((table (pop tables)) (enable-fun (abbrev-table-get table :enable-function))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq res (and (or (not enable-fun) (funcall enable-fun)) (let ((re ...)) (if (null re) (let ... ... ... ... ...) (when ... ... ...))) (setq name (buffer-substring start end)) (let ((abbrev ...)) (when abbrev (setq enable-fun ...) (and ... ...)) ))) (goto-char pos))) res) (let ((tables (abbrev--active-tables)) (pos (point)) start end name res) (if abbrev-start-location (progn (setq start abbrev-start-location) (setq abbrev-start-location nil) (if (and (< start (point-max)) (eq (char-after start) 45)) (delete-region start (1+ start))) (skip-syntax-backward " ") (setq end (point)) (when (> end start) (setq name (buffer-substring start end)) (goto-char pos) (list (abbrev-symbol name tables) name start end))) (while (and tables (not (car res))) (let* ((table (pop tables)) (enable-fun (abbrev-table-get table :enable-function))) (setq tables (append (abbrev-table-get table :parents) tables)) (setq res (and (or (not enable-fun) (funcall enable-fun)) (let (...) (if ... ... ...)) (setq name (buffer-substring start end)) (let (...) (when abbrev ... ...)))) (goto-ch ar pos))) res)) abbrev--before-point() (let* ((--cl-rest-- (abbrev--before-point)) (sym (pop --cl-rest--)) (name (pop --cl-rest--)) (wordstart (pop --cl-rest--)) (wordend (pop --cl-rest--))) (if --cl-rest-- (signal (quote wrong-number-of-arguments) (list nil (+ 4 (length --cl-rest--))))) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend))) (progn (let* ((--cl-rest-- (abbrev--before-point)) (sym (pop --cl-rest--)) (name (pop --cl-rest--)) (wordstart (pop --cl-rest--)) (wordend (pop --cl-rest--))) (if --cl-rest-- (signal (quote wrong-number-of-arguments) (list nil (+ 4 (length --cl-rest--))))) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend))) (closure ((args) (global) (funs) (runrestofhook closure (#2 t) (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda ... ...) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym ... ... ... ... ...))) args))) t) nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend))))() apply((closure ((args) (global) (funs) (runrestofhook closure (#2 t) (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda ... ...) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym ... ... ... ... ...))) args))) t) nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) nil) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda (funs global &rest args) (funcall runrestofhook funs global args)) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive (window-minibuffer-p ...)) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) args)) (closure ((runrestofhook closure #1 (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda ... ...) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym ... ... ... ... ...))) args))) t) (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda (funs global &rest args) (funcall runrestofhook funs global args)) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive ...) (undo-boundary)) (setq l ast-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) args)))(nil nil nil) funcall((closure ((runrestofhook closure #1 (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda ... ...) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym ... ... ... ... ...))) args))) t) (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda (funs global &rest args) (funcall runrestofhook funs global args)) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive ...) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) args))) nil nil nil) (let (runrestofhook) (setq runrestofhook (lambda (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global (cdr funs)) nil args) (apply (car funs) (apply-partially (lambda ... ...) (cdr funs) global) args)) (apply (lambda nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym ... ... ... ... ...))) args)))) (funcall runrestofhook abbrev-expand-functions (if (local-variable-p (quote abbrev-expand-functions)) (default-value (quote abbrev-expand-functions))) (list))) (letrec ((runrestofhook (lambda (funs global args) (if (consp funs) (if (eq t (car funs)) (funcall runrestofhook (append global ...) nil args) (apply (car funs) (apply-partially ... ... global) args)) (apply (lambda nil (destructuring-bind ... ... ...)) args))))) (funcall runrestofhook abbrev-expand-functions (if (local-variable-p (quote abbrev-expand-functions)) (default-value (quote abbrev-expand-functions))) (list))) (with-wrapper-hook abbrev-expand-functions nil (destructuring-bind (&optional sym name wordstart wordend) (abbrev--before-point) (when sym (unless (or noninteractive (window-minibuffer-p (selected-window))) (undo-boundary)) (setq last-abbrev-text name) (setq last-abbrev sym) (setq last-abbrev-location wordstart) (abbrev-insert sym name wordstart wordend)))) expand-abbrev() eval-buffer(# nil "/home/kimr/.emacs24-abbrev-bug" nil t) ; Reading at buffer position 215 load-with-code-conversion("/home/kimr/.emacs24-abbrev-bug" "/home/kimr/.emacs24-abbrev-bug" nil t) load("/home/kimr/.emacs24-abbrev-bug" nil t) command-line-1(("-l" "/home/kimr/.emacs24-abbrev-bug")) command-line() normal-top-level() If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /home/kimr/src/emacs-bzr/trunk_20110704/etc/DEBUG. In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-07-04 on kimr-laptop Windowing system distributor `The X.Org Foundation', version 11.0.11001000 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 Major mode: Debugger Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC < C-x 1 ESC x r e p o r t - SPC Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Loading /u/kimr/src/emacs-bzr/emacs24_latest/lisp/abbrev.el (source)...done Entering debugger... Mark set Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr message sendmail regexp-opt format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader emacsbug help-mode easymenu view debug easy-mmode cl time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)