Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3644040B967 for ; Sat, 17 Jul 2010 04:55:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FFkicAujH4Fa for ; Sat, 17 Jul 2010 04:55:15 -0700 (PDT) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) by olra.theworths.org (Postfix) with ESMTP id D288340B964 for ; Sat, 17 Jul 2010 04:55:14 -0700 (PDT) Received: by eydd26 with SMTP id d26so863984eyd.26 for ; Sat, 17 Jul 2010 04:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:in-reply-to :references:user-agent:date:message-id:mime-version:content-type; bh=2iUTs8DFosMQOLa4my3R056Yf1V+eINnMbOA6bd3cGA=; b=m0oxcFbS1PkzrxSIqMLGkvw7X7P+UmPLJmZWuGCMbvbSwvTmluWGqAPCSPCh6yqSlf of42XLY5NxNqf5PJBgtAoHPWYmMsufIg6e64yp58ePSl/c9PLkAhJFCsyMhxs25snIf0 qFhSEXu4Bu9npawn6qcm17B8Qgvv7kzla4Iys= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; b=qOw734FEpt3wn3LrCfvki/9HudXEq01tSA5Ah17WCL/yzOOqvuktiEa1Eb1oX7P/Ft iG7xFG3OrtOf4yP2tsJMJCDooEW9kImCOLCZfmB8MO6o65KEeLpf2UmFpuFzqT8VKkIa Vq1zyffxHRK4l+8PWO4f5vcJNodcNqICcLoMc= Received: by 10.213.20.142 with SMTP id f14mr2260490ebb.30.1279367711700; Sat, 17 Jul 2010 04:55:11 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id z55sm27315576eeh.15.2010.07.17.04.55.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Jul 2010 04:55:09 -0700 (PDT) From: Dmitry Kurochkin To: Michal Sojka , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: Fix stack overflow in notmuch-wash-tidy-citations In-Reply-To: <1279279955-3110-1-git-send-email-sojkam1@fel.cvut.cz> References: <1279279955-3110-1-git-send-email-sojkam1@fel.cvut.cz> User-Agent: Notmuch/0.3.1-61-ge828543 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Sat, 17 Jul 2010 15:55:18 +0400 Message-ID: <87eif2tja1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jul 2010 11:55:26 -0000 Hi Michal. On Fri, 16 Jul 2010 13:32:35 +0200, Michal Sojka wrote: > The following message (146 kB) breaks the emacs interface: > http://rtime.felk.cvut.cz/~sojka/notmuch/notmuch-wash-tidy-citations-stack-overflow.txt > > An attempt to view the message produced message > "notmuch-wash-tidy-citations: Stack overflow in regexp matcherq" and > it was not possible to work with the message. > > I tracked the problem down to the regexp search, which probably > attempts to match a very big piece of text (several lines). I changed > the regexp to only match a single line. The result is probably slower, > but doesn't produce the error. I have 2 messages that cause emacs segfault. Both are notifications from svn. One is 37933 lines, 1,2M. Another is huge - 963179 lines, 31M. I believe the root cause is the same for both segfaults. Your patch does not fix the problem, unfortunately. Can you advise how to debug this segfault? Build emacs with debug symbols and get backtrace from gdb? Debug notmuch lisp code (how?)? Enable some verbose logging in emacs? Regards, Dmitry > --- > emacs/notmuch-wash.el | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el > index 26a3f88..051dd17 100644 > --- a/emacs/notmuch-wash.el > +++ b/emacs/notmuch-wash.el > @@ -218,7 +218,7 @@ Perform four transformations on the message body: > > ;; Insert a blank line before a citation if there isn't one. > (goto-char (point-min)) > - (while (re-search-forward "\\(^[^>]+\\)\n>" nil t) > + (while (re-search-forward "\\(^[^>][^\n]+\\)\n>" nil t) > (replace-match "\\1\n\n>")) > > ;; Insert a blank line after a citation if there isn't one. > -- > 1.7.1.3.g75e44 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch