Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 99 / 5cf33d5da1640bd2017694adaf1f1828c39c40
1 Return-Path: <bounces+20160609-bremner=debian.org@tracker.debian.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 arlo.cworth.org (Postfix) with ESMTP id 1FD286DE01C2\r
6  for <notmuch@notmuchmail.org>; Thu,  9 Jun 2016 08:44:36 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.154\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.154 tagged_above=-999 required=5\r
12  tests=[AWL=-1.155, HEADER_FROM_DIFFERENT_DOMAINS=0.001]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id 8_30yotZM4k9 for <notmuch@notmuchmail.org>;\r
17  Thu,  9 Jun 2016 08:44:27 -0700 (PDT)\r
18 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id A6EEC6DE01BE\r
20  for <notmuch@notmuchmail.org>; Thu,  9 Jun 2016 08:44:27 -0700 (PDT)\r
21 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
22  (envelope-from <bounces+20160609-bremner=debian.org@tracker.debian.org>)\r
23  id 1bB27w-0003ly-4r\r
24  for notmuch@notmuchmail.org; Thu, 09 Jun 2016 11:44:12 -0400\r
25 Received: (nullmailer pid 558 invoked by uid 1000);\r
26  Thu, 09 Jun 2016 15:44:21 -0000\r
27 Resent-To: notmuch@notmuchmail.org\r
28 Resent-From: David Bremner <david@tethera.net>\r
29 Resent-Date: Thu, 09 Jun 2016 12:44:21 -0300\r
30 Resent-Message-ID: <87wplyxt7u.fsf@tesseract.cs.unb.ca>\r
31 Received: from mailly.debian.org ([2001:41b8:202:deb:6564:a62:52c3:4b72])\r
32  by fethera.tethera.net with esmtp (Exim 4.84)\r
33  (envelope-from <bounces+20160609-bremner=debian.org@tracker.debian.org>)\r
34  id 1bAxjp-0008T2-FK\r
35  for david@tethera.net; Thu, 09 Jun 2016 07:03:01 -0400\r
36 Received: from ticharich.debian.org ([2001:41c8:1000:21::21:23])\r
37  from C=NA, ST=NA, L=Ankh Morpork, O=Debian SMTP, OU=Debian SMTP CA,\r
38  CN=ticharich.debian.org, EMAIL=hostmaster@ticharich.debian.org (verified)\r
39  by mailly.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\r
40  (Exim 4.84_2)\r
41  (envelope-from <bounces+20160609-bremner=debian.org@tracker.debian.org>)\r
42  id 1bAxk0-0004GV-Nd\r
43  for david@tethera.net; Thu, 09 Jun 2016 11:03:12 +0000\r
44 Received: from localhost ([::1] helo=ticharich.debian.org)\r
45  by ticharich.debian.org with esmtp (Exim 4.84_2)\r
46  (envelope-from <bounces+20160609-bremner=debian.org@tracker.debian.org>)\r
47  id 1bAxk0-00069c-DW\r
48  for david@tethera.net; Thu, 09 Jun 2016 11:03:12 +0000\r
49 Received: from muffat.debian.org ([2607:f8f0:610:4000:6564:a62:ce0c:1392])\r
50  from C=NA, ST=NA, L=Ankh Morpork, O=Debian SMTP, OU=Debian SMTP CA,\r
51  CN=muffat.debian.org, EMAIL=hostmaster@muffat.debian.org (verified)\r
52  by ticharich.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\r
53  (Exim 4.84_2) (envelope-from <debbugs@buxtehude.debian.org>)\r
54  id 1bAxk0-00069V-4O\r
55  for dispatch+notmuch@tracker.debian.org; Thu, 09 Jun 2016 11:03:12 +0000\r
56 Received: from quantz.debian.org ([2001:41c8:1000:21::21:28])\r
57  from C=NA, ST=NA, L=Ankh Morpork, O=Debian SMTP, OU=Debian SMTP CA,\r
58  CN=quantz.debian.org, EMAIL=hostmaster@quantz.debian.org (verified)\r
59  by muffat.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\r
60  (Exim 4.84_2) (envelope-from <debbugs@buxtehude.debian.org>)\r
61  id 1bAxjx-0005AY-PW\r
62  for dispatch+notmuch@tracker.debian.org; Thu, 09 Jun 2016 11:03:10 +0000\r
63 Received: from qa by quantz.debian.org with local (Exim 4.84_2)\r
64  (envelope-from <debbugs@buxtehude.debian.org>) id 1bAxjw-0006ua-BG\r
65  for dispatch+notmuch@tracker.debian.org; Thu, 09 Jun 2016 11:03:08 +0000\r
66 Received: from buxtehude.debian.org ([2607:f8f0:610:4000:2015:12:0:147])\r
67  from C=NA, ST=NA, L=Ankh Morpork, O=Debian SMTP, OU=Debian SMTP CA,\r
68  CN=buxtehude.debian.org, EMAIL=hostmaster@buxtehude.debian.org (verified)\r
69  by quantz.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\r
70  (Exim 4.84_2) (envelope-from <debbugs@buxtehude.debian.org>)\r
71  id 1bAxjw-0006tk-4N\r
72  for notmuch@packages.qa.debian.org; Thu, 09 Jun 2016 11:03:08 +0000\r
73 Received: from debbugs by buxtehude.debian.org with local (Exim 4.84_2)\r
74  (envelope-from <debbugs@buxtehude.debian.org>)\r
75  id 1bAxjt-0005Bk-Ec; Thu, 09 Jun 2016 11:03:05 +0000\r
76 X-Loop: owner@bugs.debian.org\r
77 Subject: Bug#826843: Calls to notmuch_database_add_message() after\r
78  notmuch_database_close() crash\r
79 Reply-To: Lars Luthman <deb-bugs@larsluthman.net>, 826843@bugs.debian.org\r
80 Also-Resent-From: Lars Luthman <deb-bugs@larsluthman.net>\r
81 Also-Resent-To: debian-bugs-dist@lists.debian.org\r
82 Also-Resent-CC: Carl Worth <cworth@debian.org>\r
83 X-Loop: owner@bugs.debian.org\r
84 Also-Resent-Date: Thu, 09 Jun 2016 11:03:01 +0000\r
85 Also-Resent-Message-ID: <handler.826843.B.146547014919804@bugs.debian.org>\r
86 X-Debian-PR-Message: report 826843\r
87 X-Debian-PR-Package: libnotmuch-dev\r
88 X-Debian-PR-Keywords: \r
89 X-Debian-PR-Source: notmuch\r
90 Received: via spool by submit@bugs.debian.org id=B.146547014919804\r
91  (code B); Thu, 09 Jun 2016 11:03:01 +0000\r
92 Received: (at submit) by bugs.debian.org; 9 Jun 2016 11:02:29 +0000\r
93 X-Spam-Bayes: score:0.0000 Tokens: new, 47; hammy, 150; neutral, 161; spammy,\r
94  0. spammytokens: hammytokens:0.000-+--systemd, 0.000-+--deb8u1, \r
95  0.000-+--H*UA:3.12.9-1, 0.000-+--H*x:3.12.9-1, 0.000-+--en_GButf8\r
96 Received: from v-smtpgw2.han.skanova.net ([81.236.60.205])\r
97  by buxtehude.debian.org with esmtp (Exim 4.84_2)\r
98  (envelope-from <deb-bugs@larsluthman.net>) id 1bAxjJ-00058n-Da\r
99  for submit@bugs.debian.org; Thu, 09 Jun 2016 11:02:29 +0000\r
100 Received: from miskatonic.local ([78.69.244.232]) by cmsmtp with SMTP\r
101  id Axj9bO3cdctqUAxjAb5kXm; Thu, 09 Jun 2016 13:02:21 +0200\r
102 Message-ID: <1465470142.3501.10.camel@larsluthman.net>\r
103 From: Lars Luthman <deb-bugs@larsluthman.net>\r
104 To: submit@bugs.debian.org\r
105 Date: Thu, 09 Jun 2016 13:02:22 +0200\r
106 Content-Type: multipart/mixed; boundary="=-6lshnzaqf1KN2rKF0TKb"\r
107 X-Mailer: Evolution 3.12.9-1+b1 \r
108 Mime-Version: 1.0\r
109 X-CMAE-Envelope: MS4wfMMdDsIM1l3Qa1f8AMdqkBLsZulSFkVnPILa/7bnKy7vEm4kePEgzC6NTWfUzgizPIZAc6sUB2evyOmtpQUgDjqXQ6LEQxTtw+vIUvUyHA7aLhnK00Hl\r
110  FQksKsJl/A76jQ8iymRFjr2C22qm20As/LrAUsbskpt9lKP8xDC8VLW511/i88tLX5zSWk/3fOrzaA==\r
111 X-Loop: dispatch@tracker.debian.org\r
112 X-Distro-Tracker-Package: notmuch\r
113 X-Distro-Tracker-Keyword: bts\r
114 X-Debian-Package: notmuch\r
115 X-Debian: tracker.debian.org\r
116 X-PTS-Package: notmuch\r
117 X-PTS-Keyword: bts\r
118 Precedence: list\r
119 X-Mailman-Approved-At: Thu, 09 Jun 2016 09:50:52 -0700\r
120 X-BeenThere: notmuch@notmuchmail.org\r
121 X-Mailman-Version: 2.1.20\r
122 List-Id: "Use and development of the notmuch mail system."\r
123  <notmuch.notmuchmail.org>\r
124 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
125  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
126 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
127 List-Post: <mailto:notmuch@notmuchmail.org>\r
128 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
129 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
130  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
131 X-List-Received-Date: Thu, 09 Jun 2016 15:44:36 -0000\r
132 \r
133 \r
134 --=-6lshnzaqf1KN2rKF0TKb\r
135 Content-Type: text/plain; charset="UTF-8"\r
136 Content-Transfer-Encoding: 7bit\r
137 \r
138 Package: libnotmuch-dev\r
139 Version: 0.18.2-1\r
140 Severity: important\r
141 \r
142 In the API documentation for notmuch_database_close() it says:\r
143 \r
144  * After notmuch_database_close has been called, calls to other\r
145  * functions on objects derived from this database may either behave\r
146  * as if the database had not been closed (e.g., if the required data\r
147  * has been cached) or may fail with a\r
148  * NOTMUCH_STATUS_XAPIAN_EXCEPTION.\r
149 \r
150 However, if you call notmuch_database_close() on a database and then\r
151 call notmuch_database_add_message(), it doesn't fail nicely with a\r
152 NOTMUCH_STATUS_XAPIAN_EXCEPTION, it segfaults.\r
153 \r
154 This should either be fixed so it doesn't crash, as documented, or the\r
155 documentation should be changed to describe which functions are unsafe\r
156 to call after notmuch_database_close().\r
157 \r
158 I'm attaching a small C program to reproduce the bug. It crashes with\r
159 the following backtrace:\r
160 \r
161 (gdb) bt\r
162 #0  0xb71f3f27 in Xapian::WritableDatabase::begin_transaction(bool) ()\r
163    from /usr/lib/sse2/libxapian.so.22\r
164 #1  0xb779480d in notmuch_database_begin_atomic ()\r
165    from /usr/lib/i386-linux-gnu/libnotmuch.so.3\r
166 #2  0xb7794fa0 in notmuch_database_add_message ()\r
167    from /usr/lib/i386-linux-gnu/libnotmuch.so.3\r
168 #3  0x080488d3 in add_new_email (db=0x82b5610, \r
169     filename=0x8048b51 "/new-mail-2@example.net:2,", content=0x8048b30\r
170 "hello")\r
171     at notmuchcrash.c:27\r
172 #4  0x080489d7 in main () at notmuchcrash.c:52\r
173 \r
174 \r
175 Installed version of libxapian22: 1.2.19-1+deb8u1\r
176 \r
177 \r
178 -- System Information:\r
179 Debian Release: 8.5\r
180   APT prefers stable-updates\r
181   APT policy: (500, 'stable-updates'), (500, 'stable')\r
182 Architecture: i386 (i686)\r
183 \r
184 Kernel: Linux 3.16.0-4-686-pae (SMP w/2 CPU cores)\r
185 Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)\r
186 Shell: /bin/sh linked to /bin/dash\r
187 Init: systemd (via /run/systemd/system)\r
188 \r
189 Versions of packages libnotmuch-dev depends on:\r
190 ii  libnotmuch3  0.18.2-1\r
191 \r
192 libnotmuch-dev recommends no packages.\r
193 \r
194 libnotmuch-dev suggests no packages.\r
195 \r
196 -- no debconf information\r
197 \r
198 --=-6lshnzaqf1KN2rKF0TKb\r
199 Content-Disposition: attachment; filename="notmuchcrash.c"\r
200 Content-Type: text/x-csrc; name="notmuchcrash.c"; charset="UTF-8"\r
201 Content-Transfer-Encoding: base64\r
202 \r
203 LyogQ29tcGlsZSB3aXRoOgogICBnY2MgLWcgLXN0ZD1jOTkgLVdhbGwgLVdlcnJvciAtbyBub3Rt\r
204 dWNoY3Jhc2ggLWxub3RtdW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