From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#13802: stack overflow in mm-add-meta-html-tag Date: Thu, 30 Jan 2014 16:38:49 -0800 Message-ID: <8761p17zom.fsf@building.gnus.org> References: <87wqtyrry6.fsf@zigzag.favinet> <87y5edmdxw.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1391128811 9374 80.91.229.3 (31 Jan 2014 00:40:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2014 00:40:11 +0000 (UTC) Cc: Thien-Thi Nguyen , 13802@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 31 01:40:18 2014 Return-path: Envelope-to: geb-bug-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 1W929Z-0005bO-Mq for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jan 2014 01:40:17 +0100 Original-Received: from localhost ([::1]:52831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W929Z-0000lz-BC for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 19:40:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W929R-0000jo-08 for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2014 19:40:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W929L-0005KH-Iy for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2014 19:40:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W929L-0005Iz-Fm for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2014 19:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W929J-0001HD-Tz; Thu, 30 Jan 2014 19:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 31 Jan 2014 00:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13802 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 13802-submit@debbugs.gnu.org id=B13802.13911287974892 (code B ref 13802); Fri, 31 Jan 2014 00:40:01 +0000 Original-Received: (at 13802) by debbugs.gnu.org; 31 Jan 2014 00:39:57 +0000 Original-Received: from localhost ([127.0.0.1]:42020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W929E-0001Gq-G8 for submit@debbugs.gnu.org; Thu, 30 Jan 2014 19:39:56 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:59370) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W929B-0001Gh-Uc for 13802@debbugs.gnu.org; Thu, 30 Jan 2014 19:39:54 -0500 Original-Received: from [204.14.154.233] (helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W928w-000337-Om; Fri, 31 Jan 2014 01:39:39 +0100 In-Reply-To: <87y5edmdxw.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 25 Feb 2013 02:20:39 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1W928w-000337-Om MailScanner-NULL-Check: 1391733579.83931@y8rPTrrzG1i9ckXVJhDyiw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:84308 Archived-At: Juri Linkov writes: >> I see a "Stack overflow in regexp matcher" error traceable back to >> lisp/gnus/mm-decode.el func =91mm-add-meta-html-tag=92 fragment: >> >> (re-search-forward "\ >> > text/\\(\\sw+\\)\\(?:\;\\s-*charset=3D\\(.+\\)\\)?[\"'][^>]*>" nil t) >> >> To allow the user (not me) to continue, i kludged the form to be: >> >> (ignore-errors >> (re-search-forward "..." nil t)) >> >> that is, wrapping w/ =91ignore-errors=92. Is there a better solution? > > `sgml-html-meta-auto-coding-function' uses a similar regexp > that doesn't fail with stack overflow. You could get some ideas > from this regexp and sync the regexp in `mm-add-meta-html-tag' with it. I've adapted the regexp from that function in the patch below, but since I don't have a test case, I'm not really sure about committing it. Thien-Thi, could you post the message that triggers this error, or the relevant bits of it? diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 17c8fb1..eaf9de4 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -1405,9 +1405,7 @@ Return t if meta tag is added or replaced." = " charset)) (let ((case-fold-search t)) (goto-char (point-min)) - (if (re-search-forward "\ -]+\\)\\)?[^>]*>" nil t) + (if (re-search-forward "]" nil t) (if (and (not force-charset) (match-beginning 2) (string-match "\\`html\\'" (match-string 1))) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/