From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.help Subject: BUG 20703 further evidence Date: Wed, 13 Jan 2016 09:54:48 -0800 (PST) Message-ID: <5ab4af6b-5b7d-40f9-b49f-2d8cc6926e9f@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452707723 16466 80.91.229.3 (13 Jan 2016 17:55:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jan 2016 17:55:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 13 18:55:22 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aJPdi-0008DT-1Z for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jan 2016 18:55:22 +0100 Original-Received: from localhost ([::1]:38656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJPde-0003cC-9B for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Jan 2016 12:55:18 -0500 X-Received: by 10.66.100.201 with SMTP id fa9mr122744257pab.11.1452707688764; Wed, 13 Jan 2016 09:54:48 -0800 (PST) X-Received: by 10.50.108.20 with SMTP id hg20mr9023igb.5.1452707688734; Wed, 13 Jan 2016 09:54:48 -0800 (PST) Original-Path: usenet.stanford.edu!h5no3966040igh.0!news-out.google.com!kr2ni3987igb.0!nntp.google.com!o2no2601416iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=86.21.102.205; posting-account=kRukCAoAAAANs-vsVh9dFwo5kp5pwnPz Original-NNTP-Posting-Host: 86.21.102.205 User-Agent: G2/1.0 Injection-Date: Wed, 13 Jan 2016 17:54:48 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:216427 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108717 Archived-At: Hi all, I have been seeing a problem that is described in this bug report https://debbugs.gnu.org/db/20/20703.html I have applied the suggested patch to etags-tags-completion-table (copied b= elow in completeness for your convenience) and trapped an error case. I'm triggering the error in an extremely long line of code (46,000 characte= rs!). I presume somebody programmatically generated the line and pasted it = into the source. A workaround could be to simply filter such lines at the c= tag building or loading stage, just something that deletes "long" lines, wh= atever that may mean. Probably 500 characters is long enough! I could also look at adding maximum sizes to my regexes in ctags, but that = really isn't a general solution because many ctags patterns do not have suc= h limits. (defun etags-tags-completion-table () ; Doc string? (let ((table (make-vector 511 0)) (progress-reporter (make-progress-reporter (format "Making tags completion table for %s..." buffer-file-name= ) (point-min) (point-max)))) (save-excursion (goto-char (point-min)) ;; This monster regexp matches an etags tag line. ;; \1 is the string to match; ;; \2 is not interesting; ;; \3 is the guessed tag name; XXX guess should be better eg DEFUN ;; \4 is not interesting; ;; \5 is the explicitly-specified tag name. ;; \6 is the line to start searching at; ;; \7 is the char to start searching at. (condition-case err (while (re-search-forward "^\\(\\([^\177]+[^-a-zA-Z0-9_+*$:\177]+\\)?\ \\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\ \\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n" nil t) (intern (prog1 (if (match-beginning 5) ;; There is an explicit tag name. (buffer-substring (match-beginning 5) (match= -end 5)) ;; No explicit tag name. Best guess. (buffer-substring (match-beginning 3) (match-e= nd 3))) (progress-reporter-update progress-reporter (point))) table)) (error (message "error happened near %d" (point)) (error (error-message-string err))))) table))