Re: Avoiding the "huge INBOX of death"
[notmuch-archives.git] / 57 / ba34e699c0d7570c4d3bbceaff8f8583866b08
1 Return-Path: <kaz.rag@gmail.com>\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 CA6BA429E25\r
6         for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 09:35:47 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id RHlxP5EbJO+A for <notmuch@notmuchmail.org>;\r
17         Sun,  4 Dec 2011 09:35:46 -0800 (PST)\r
18 Received: from mail-gy0-f181.google.com (mail-gy0-f181.google.com\r
19         [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id B9FB6429E21\r
22         for <notmuch@notmuchmail.org>; Sun,  4 Dec 2011 09:35:46 -0800 (PST)\r
23 Received: by ghbg18 with SMTP id g18so5313407ghb.26\r
24         for <notmuch@notmuchmail.org>; Sun, 04 Dec 2011 09:35:45 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=date:from:to:subject:message-id:mime-version:content-type\r
27         :content-disposition:content-transfer-encoding:user-agent;\r
28         bh=dmAXVZWjj8D6bM3A56k/eXEHhrC1Y1Jw1Z0ASrjmF38=;\r
29         b=xXmpUmFpxlFCxXopJjgnpwXTYnDun6Gry1S0+HKyTQAAUR3uc29lwz3WEQu9YgWVKX\r
30         kkxIHcGSP5eEsC4NNjmOMrS2fL/ruuyaeNHqUK6l//9voUkDn1tffyxLlhdZFzCLUqmd\r
31         BtIT8aDRsE4iKAQyL+GjqmRH4Cfs5PzqqbgWA=\r
32 Received: by 10.236.76.136 with SMTP id b8mr8391564yhe.9.1323020145020;\r
33         Sun, 04 Dec 2011 09:35:45 -0800 (PST)\r
34 Received: from localhost ([187.35.51.138])\r
35         by mx.google.com with ESMTPS id j25sm26641984yhm.12.2011.12.04.09.35.42\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sun, 04 Dec 2011 09:35:43 -0800 (PST)\r
38 Date: Sun, 4 Dec 2011 15:35:39 -0200\r
39 From: Kazuo Teramoto <kaz.rag@gmail.com>\r
40 To: notmuch@notmuchmail.org\r
41 Subject: notmuch seg. fault on _thread_add_message\r
42 Message-ID: <20111204173539.GA4411@sophie>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=utf-8\r
45 Content-Disposition: inline\r
46 Content-Transfer-Encoding: 8bit\r
47 User-Agent: Mutt/1.5.21 (2010-09-15)\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Sun, 04 Dec 2011 17:35:47 -0000\r
61 \r
62 Hi!\r
63 \r
64 Following an alot bug report [1] I created a small python script that\r
65 causes a segmentation fault in notmuch:\r
66 ========================================================================\r
67 #!/usr/bin/env python2\r
68 import notmuch\r
69 db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
70 q_new = notmuch.Query(db, 'tag:inbox')\r
71 for t in q_new.search_threads():\r
72     pass\r
73 ========================================================================\r
74 \r
75 With gdb I get the following\r
76 ========================================================================\r
77 GNU gdb (GDB) 7.3.1\r
78 Copyright (C) 2011 Free Software Foundation, Inc.\r
79 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r
80 This is free software: you are free to change and redistribute it.\r
81 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"\r
82 and "show warranty" for details.\r
83 This GDB was configured as "x86_64-unknown-linux-gnu".\r
84 For bug reporting instructions, please see:\r
85 <http://www.gnu.org/software/gdb/bugs/>...\r
86 Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.\r
87 (gdb) run /tmp/test_notmuch.py \r
88 Starting program: /usr/bin/python2 /tmp/test_notmuch.py\r
89 [Thread debugging using libthread_db enabled]\r
90 \r
91 (process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()\r
92 \r
93 (process:16579): GLib-GObject-CRITICAL **: g_object_newv: assertion `G_TYPE_IS_OBJECT (object_type)' failed\r
94 \r
95 (process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()\r
96 \r
97 (process:16579): GLib-GObject-CRITICAL **: gtype.c:2715: You forgot to call g_type_init()\r
98 \r
99 (process:16579): GLib-GObject-CRITICAL **: g_object_newv: assertion `G_TYPE_IS_OBJECT (object_type)' failed\r
100 \r
101 Program received signal SIGSEGV, Segmentation fault.\r
102 0x00007ffff4deb86e in decode_addrspec (in=0x7fffffffac80) at internet-address.c:1459\r
103 1459            ((InternetAddressMailbox *) mailbox)->addr = addr->str;\r
104 (gdb) bt\r
105 #0  0x00007ffff4deb86e in decode_addrspec (in=0x7fffffffac80) at internet-address.c:1459\r
106 #1  0x00007ffff4debb1d in decode_address (in=0x7fffffffacf0) at internet-address.c:1558\r
107 #2  0x00007ffff4debe83 in internet_address_list_parse_string (str=0x7b1bc0 "Jani Nikula <jani@nikula.org>") at internet-address.c:1692\r
108 #3  0x00007ffff503257b in _thread_add_message (thread=0x7d87f0, message=0x6d9480) at lib/thread.cc:236\r
109 #4  0x00007ffff5032d7b in _notmuch_thread_create (ctx=0x7cadd0, notmuch=0x615590, seed_doc_id=6515, match_set=0xe65528, sort=NOTMUCH_SORT_NEWEST_FIRST) at lib/thread.cc:470\r
110 #5  0x00007ffff503165b in notmuch_threads_get (threads=0xe65510) at lib/query.cc:392\r
111 #6  0x00007ffff6636e34 in ffi_call_unix64 () from /usr/lib/libffi.so.5\r
112 #7  0x00007ffff6636855 in ffi_call () from /usr/lib/libffi.so.5\r
113 #8  0x00007ffff684a1f7 in _ctypes_callproc () from /usr/lib/python2.7/lib-dynload/_ctypes.so\r
114 #9  0x00007ffff6843a86 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so\r
115 #10 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0\r
116 #11 0x00007ffff7afcbda in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0\r
117 #12 0x00007ffff7aff8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0\r
118 #13 0x00007ffff7a8c15c in function_call () from /usr/lib/libpython2.7.so.1.0\r
119 #14 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0\r
120 #15 0x00007ffff7a762bf in instancemethod_call () from /usr/lib/libpython2.7.so.1.0\r
121 #16 0x00007ffff7a67683 in PyObject_Call () from /usr/lib/libpython2.7.so.1.0\r
122 #17 0x00007ffff7abd002 in call_method () from /usr/lib/libpython2.7.so.1.0\r
123 #18 0x00007ffff7af9b1f in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0\r
124 #19 0x00007ffff7aff8ef in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0\r
125 #20 0x00007ffff7affa22 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0\r
126 #21 0x00007ffff7b19d8c in run_mod () from /usr/lib/libpython2.7.so.1.0\r
127 #22 0x00007ffff7b1ab90 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0\r
128 #23 0x00007ffff7b1b60f in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0\r
129 #24 0x00007ffff7b2cd25 in Py_Main () from /usr/lib/libpython2.7.so.1.0\r
130 #25 0x00007ffff749b14d in __libc_start_main () from /lib/libc.so.6\r
131 #26 0x00000000004006a1 in _start ()\r
132 (gdb) list\r
133 1454                    g_string_free (addr, TRUE);\r
134 1455                    return NULL;\r
135 1456            }\r
136 1457            \r
137 1458            mailbox = g_object_newv (INTERNET_ADDRESS_TYPE_MAILBOX, 0, NULL);\r
138 1459            ((InternetAddressMailbox *) mailbox)->addr = addr->str;\r
139 1460            g_string_free (addr, FALSE);\r
140 1461            \r
141 1462            return mailbox;\r
142 1463    }\r
143 (gdb) info locals\r
144 mailbox = 0x0\r
145 start = 0x7b1bcd "jani@nikula.org>"\r
146 inptr = 0x7b1bdc ">"\r
147 word = 0x7b1bcd "jani@nikula.org>"\r
148 got_local = 1\r
149 addr = 0x8f8d20\r
150 len = 4\r
151 (gdb) frame 3\r
152 #3  0x00007ffff503257b in _thread_add_message (thread=0x7d87f0, message=0x6d9480) at lib/thread.cc:236\r
153 236             list = internet_address_list_parse_string (from);\r
154 (gdb) l\r
155 231                              xstrdup (notmuch_message_get_message_id (message)),\r
156 232                              message);\r
157 233     \r
158 234         from = notmuch_message_get_header (message, "from");\r
159 235         if (from)\r
160 236             list = internet_address_list_parse_string (from);\r
161 237     \r
162 238         if (list) {\r
163 239             address = internet_address_list_get_address (list, 0);\r
164 240             if (address) {\r
165 (gdb) info locals\r
166 list = 0x0\r
167 from = 0x7b1bc0 "Jani Nikula <jani@nikula.org>"\r
168 tags = 0x7b2850\r
169 tag = 0x7fffffffad60 "\300\033{"\r
170 address = 0x7b2850\r
171 author = 0x7fffffffafa8 ""\r
172 clean_author = 0x6d9480 "\220Ua"\r
173 (gdb) \r
174 ========================================================================\r
175 \r
176 Is the NULL on mailbox ok? This code is from gmime. I'm using gmime\r
177 2.4.28 and notmuch from git (0.10+58~g1c81e8f).\r
178 \r
179 Regards,\r
180 Kazuo.\r
181 \r
182 [1]: https://github.com/pazz/alot/issues/142\r
183 \r
184 -- \r
185 “The journey is more important than the destination—that’s\r
186 part of life, if you only live for getting to the end, you’re\r
187 almost always disappointed.”\r
188 \r
189 Donald E. Knuth\r