unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Dominik Epple <dominik.epple@googlemail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: notmuch new: Memory problem (with uuencoded content)
Date: Fri, 05 Feb 2010 10:59:12 -0800	[thread overview]
Message-ID: <87d40jpkzj.fsf@yoom.home.cworth.org> (raw)
In-Reply-To: <87vdgxqepm.fsf@yoom.home.cworth.org>

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

On Thu, 26 Nov 2009 11:16:21 -0800, Carl Worth <cworth@cworth.org> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2010-02-05 18:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20  8:56 notmuch new: Memory problem Dominik Epple
2009-11-20 16:01 ` Carl Worth
2009-11-23 15:30   ` Dominik Epple
2009-11-20 20:56 ` Carl Worth
2009-11-23 16:26   ` Dominik Epple
2009-11-25  9:39     ` Dominik Epple
2009-11-26 18:46       ` Carl Worth
2009-11-26 19:16         ` Carl Worth
2010-02-05 18:59           ` Carl Worth [this message]
2010-02-06 10:40             ` notmuch new: Memory problem (with uuencoded content) Michal Sojka
2010-02-06 21:45               ` Carl Worth
2010-02-08 14:19                 ` Michal Sojka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d40jpkzj.fsf@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=dominik.epple@googlemail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).