[PATCH] This patch is a little finger excercise for working with git. I found a piece...
[notmuch-archives.git] / 15 / 66cf36facd2c44ae1b6c5680873f1804d2490c
1 Return-Path: <mh@glandium.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 506BC431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 05:27:04 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id 5GtjFInyAT36 for <notmuch@notmuchmail.org>;\r
11         Fri, 20 Nov 2009 05:27:04 -0800 (PST)\r
12 Received: from mout.perfora.net (mout.perfora.net [74.208.4.195])\r
13         by olra.theworths.org (Postfix) with ESMTP id 3426C431FAE\r
14         for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 05:27:04 -0800 (PST)\r
15 Received: from vuizook.err.no (vuizook.err.no [85.19.221.46])\r
16         by mx.perfora.net (node=mxus1) with ESMTP (Nemesis)\r
17         id 0MGjw9-1NOxuB44DR-00DUaZ for notmuch@notmuchmail.org;\r
18         Fri, 20 Nov 2009 08:27:03 -0500\r
19 Received: from cha92-13-88-165-248-19.fbx.proxad.net ([88.165.248.19]\r
20         helo=jigen)\r
21         by vuizook.err.no with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)\r
22         (Exim 4.69) (envelope-from <mh@glandium.org>) id 1NBTVq-0005pr-Tf\r
23         for notmuch@notmuchmail.org; Fri, 20 Nov 2009 14:27:01 +0100\r
24 Received: from mh by jigen with local (Exim 4.69) (envelope-from <mh@jigen>)\r
25         id 1NBTVJ-00050w-DR\r
26         for notmuch@notmuchmail.org; Fri, 20 Nov 2009 14:26:25 +0100\r
27 Date: Fri, 20 Nov 2009 14:26:25 +0100\r
28 From: Mike Hommey <mh+notmuch@glandium.org>\r
29 To: notmuch@notmuchmail.org\r
30 Message-ID: <20091120132625.GA19246@glandium.org>\r
31 MIME-Version: 1.0\r
32 Content-Type: text/plain; charset=us-ascii\r
33 Content-Disposition: inline\r
34 X-GPG-Fingerprint: A479 A824 265C B2A5 FC54  8D1E DE4B DA2C 54FD 2A58\r
35 User-Agent: Mutt/1.5.20 (2009-06-14)\r
36 Subject: [notmuch] Segfault with weird Message-ID\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.12\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 20 Nov 2009 13:27:04 -0000\r
50 \r
51 Hi,\r
52 \r
53 I got a segfault when importing my maildir. It happened because of an\r
54 old weird email, where the message-id is the following:\r
55 Message-ID: <000022b17a1f$00004fbe$00000550@myrop (ew6.southwind.net [216.53.98.70]) by onyx.southwind.net from homepage.com (114.230.197.216) by newmail.spectraweb.ch from default (m202.2-25.warwick.net [\r
56 218.242.202.80]) by host.warwick.net (8.10.0.Beta10/8.10.0.Beta10) with SMTP id e9GKEKk19201>\r
57 \r
58 I have absolutely no idea how it got this value, but the mail being\r
59 an archived 8 years old spam, I'm not exactly sure if anyone would \r
60 still expect such message id to occur.\r
61 \r
62 Anyways, the stack dump is the following:\r
63 #0  0x00007ffff6d1e598 in Xapian::Document::add_term(std::string const&, unsigned int) () from /usr/lib/libxapian.so.15\r
64 #1  0x000000000040f5ff in _notmuch_message_add_term (message=0x0, prefix_name=0x41ad7f "tag", value=0x4191b0 "inbox") at lib/message.cc:587\r
65 #2  0x000000000040f827 in notmuch_message_add_tag (message=0x0, tag=0x4191b0 "inbox") at lib/message.cc:668\r
66 #3  0x0000000000407bc8 in tag_inbox_and_unread (message=0x0) at notmuch-new.c:44\r
67 #4  0x0000000000407f63 in add_files_recursive (notmuch=0x62cc20, path=0x832e90 "/home/mh/Maildir/saved-messages/cur", st=0x7fffffffe000, state=0x7fffffffe240) at notmuch-new.c:185\r
68 #5  0x0000000000408036 in add_files_recursive (notmuch=0x62cc20, path=0x832de0 "/home/mh/Maildir/saved-messages", st=0x7fffffffe000, state=0x7fffffffe240) at notmuch-new.c:223\r
69 #6  0x0000000000408036 in add_files_recursive (notmuch=0x62cc20, path=0x62c920 "/home/mh/Maildir", st=0x7fffffffe000, state=0x7fffffffe240) at notmuch-new.c:223\r
70 #7  0x0000000000408245 in add_files (notmuch=0x62cc20, path=0x62c920 "/home/mh/Maildir", state=0x7fffffffe240) at notmuch-new.c:287\r
71 #8  0x0000000000408704 in notmuch_new_command (ctx=0x61f140, argc=0, argv=0x7fffffffe3e8) at notmuch-new.c:431\r
72 #9  0x0000000000406ea8 in main (argc=2, argv=0x7fffffffe3d8) at notmuch.c:400\r
73 \r
74 And the most likely problem is that message is NULL.\r
75 \r
76 Now, looking at the code, there seems to me there actually 3 problems:\r
77 - _notmuch_message_create_for_message_id can return NULL, and while\r
78   there is a test for it in notmuch_database_add_message, the function\r
79   still returns a success code\r
80 - things are still going on even when message is NULL in\r
81   add_files_recursive\r
82 - for some reason, xapian doesn't want to add the document corresponding\r
83   to this old spam message: notmuch->xapian_db->add_document throws an\r
84   exception.\r
85 \r
86 I can provide the spam if necessary, or can continue debugging the issue\r
87 with some guidance.\r
88 \r
89 Cheers,\r
90 \r
91 Mike\r