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 D9F65431FBD for ; Fri, 5 Feb 2010 10:59:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.963 X-Spam-Level: X-Spam-Status: No, score=-1.963 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.022, BAYES_40=-0.185] 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 aZa3+UAiozaW; Fri, 5 Feb 2010 10:59:19 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D166B431FAE; Fri, 5 Feb 2010 10:59:19 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 87C20254181; Sat, 6 Feb 2010 07:59:19 +1300 (NZDT) From: Carl Worth To: Dominik Epple In-Reply-To: <87vdgxqepm.fsf@yoom.home.cworth.org> References: <123554aa0911200056h73def158pb0db64a2a78ed687@mail.gmail.com> <87skc8oqyn.fsf@yoom.home.cworth.org> <123554aa0911230826o11e54d5ckc90e5ae8dab6ffd3@mail.gmail.com> <123554aa0911250139l907c4efs60d704dae962c473@mail.gmail.com> <87y6ltqg2p.fsf@yoom.home.cworth.org> <87vdgxqepm.fsf@yoom.home.cworth.org> Date: Fri, 05 Feb 2010 10:59:12 -0800 Message-ID: <87d40jpkzj.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] notmuch new: Memory problem (with uuencoded content) 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: Fri, 05 Feb 2010 18:59:21 -0000 --=-=-= On Thu, 26 Nov 2009 11:16:21 -0800, Carl Worth wrote: > Clearly, some experimenting is needed. Dominik, if you can share the > large file, (with either me alone or with the whole list), a pointer to > where we could download it would be appreciated. Dominik replied to me privately and described a way for me to create a file that replicates the bug. Here's a recipe I came up with from his description: mkdir tmp cd tmp/ echo [database]$'\n'path=mail > notmuch-config mkdir mail echo From: Me$'\n'To: You$'\n'Subject: uuencode$'\n' > mail/msg dd if=/dev/urandom of=blob bs=1024 count=10240 uuencode blob < blob >> mail/msg NOTMUCH_CONFIG=notmuch-config notmuch new So that's a 10MB blob of random data which uuencodes to a ~14MB mail file. And notmuch (before a patch I just pushed) chews on it for quite a while, consuming several hundred MB of memory and resulting finally in a 76MB Xapian database (with chert). I'm not sure if there is a Xapian bug there or not, (or perhaps a bug in how notmuch is using Xapian to generate the terms for this large of an email message). But the thing that's obvious to me is that indexing encoded data like this doesn't make any sense at all. So I've just pushed a set of patches to notmuch to make it detect uuencoded data within a mail message and ignore it. Of course, I also pushed a set of tests to the test suite for this, (and some new "notmuch search" tests while I was at it). -Carl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLbGqA6JDdNq8qSWgRAmZJAJ9LV4r6PzG1IhZBFIzxTYVu4KxicwCgleGH kv+WIZSatWQLrDvM2KtFxpQ= =6BSl -----END PGP SIGNATURE----- --=-=-=--