--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2BAF7429E2E\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Sep 2013 17:17:35 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id KA6-eqvOA4UA for <notmuch@notmuchmail.org>;\r
+ Thu, 5 Sep 2013 17:17:29 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 9CCCA429E29\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Sep 2013 17:17:29 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1VHjjo-0001kb-G1; Thu, 05 Sep 2013 21:17:24 -0300\r
+Received: (nullmailer pid 30738 invoked by uid 1000); Fri, 06 Sep 2013\r
+ 00:17:20 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: "Jason A. Donenfeld" <Jason@zx2c4.com>, notmuch ML\r
+ <notmuch@notmuchmail.org>\r
+Subject: Re: segfault with xapian 1.3.1\r
+In-Reply-To:\r
+ <CAHmME9q3H2KKBRb_VU4Rr-pc+2qR=uPxiX8YPBFE4N0DaiidAA@mail.gmail.com>\r
+References:\r
+ <CAHmME9q3H2KKBRb_VU4Rr-pc+2qR=uPxiX8YPBFE4N0DaiidAA@mail.gmail.com>\r
+User-Agent: Notmuch/0.16+37~g9701e9c (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Thu, 05 Sep 2013 21:17:20 -0300\r
+Message-ID: <87txhypzvz.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+Cc: Olly Betts <olly@survex.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 06 Sep 2013 00:17:35 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+"Jason A. Donenfeld" <Jason@zx2c4.com> writes:\r
+\r
+> As discussed on IRC, notmuch segfaults with 1.3.1 but not with 1.2.5 on\r
+> notmuch-new:\r
+>\r
+> Program received signal SIGSEGV, Segmentation fault.\r
+> 0x00007ffff75a5367 in Xapian::TermIterator::skip_to(std::string const&) ()\r
+> from /usr/lib64/libxapian-1.3.so.1\r
+> (gdb) bt\r
+\r
+I managed to duplicate this problem on Debian testing by rebuilding\r
+Olly's packages (https://launchpad.net/~ojwb/+archive/xapian-1.3) for\r
+sid and running the following script in the ./test subdirectory\r
+\r
+,----\r
+| test_description='"notmuch new" segfault'\r
+| . test-lib.sh\r
+| \r
+| generate_message\r
+| gdb notmuch <<EOF\r
+| run new\r
+| bt full\r
+| EOF\r
+`----\r
+\r
+The backtrace is attached.\r
+\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Disposition: inline; filename=backtrace.txt\r
+Content-Description: backtrace\r
+\r
+backtrace.sh: Testing "notmuch new" segfault\r
+GNU gdb (GDB) 7.6 (Debian 7.6-5)\r
+Copyright (C) 2013 Free Software Foundation, Inc.\r
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r
+This is free software: you are free to change and redistribute it.\r
+There is NO WARRANTY, to the extent permitted by law. Type "show copying"\r
+and "show warranty" for details.\r
+This GDB was configured as "x86_64-linux-gnu".\r
+For bug reporting instructions, please see:\r
+<http://www.gnu.org/software/gdb/bugs/>...\r
+Reading symbols from /home/bremner/software/upstream/notmuch/notmuch...done.\r
+(gdb) Starting program: /home/bremner/software/upstream/notmuch/notmuch new\r
+[Thread debugging using libthread_db enabled]\r
+Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".\r
+\r
+Program received signal SIGSEGV, Segmentation fault.\r
+0x00007ffff709ba37 in Xapian::TermIterator::skip_to (this=0x7fffffffdc10, term=...)\r
+ at ../api/termiterator.cc:145\r
+(gdb) #0 0x00007ffff709ba37 in Xapian::TermIterator::skip_to (this=0x7fffffffdc10, \r
+ term=...) at ../api/termiterator.cc:145\r
+No locals.\r
+#1 0x0000000000422959 in _notmuch_message_get_term (message=0x6833e0, i=..., \r
+ end=..., prefix=0x434644 "XREPLYTO") at lib/message.cc:271\r
+ prefix_len = 8\r
+ value = 0x6810a0 "\001"\r
+ term = {static npos = <optimized out>, \r
+ _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x67eaa8 "XFDIRENTRY2:msg-001"}}\r
+#2 0x0000000000422d1b in _notmuch_message_ensure_metadata (message=0x6833e0)\r
+ at lib/message.cc:347\r
+ i = {internal = 0x0}\r
+ end = {internal = 0x0}\r
+ thread_prefix = 0x4346a0 "G"\r
+ replyto_prefix = 0x434644 "XREPLYTO"\r
+ __PRETTY_FUNCTION__ = "void _notmuch_message_ensure_metadata(notmuch_message_t*)"\r
+ tag_prefix = 0x4346a6 "K"\r
+ id_prefix = 0x4346ae "Q"\r
+ filename_prefix = 0x434670 "XFDIRENTRY"\r
+#3 0x0000000000422f18 in notmuch_message_get_message_id (message=0x6833e0)\r
+ at lib/message.cc:390\r
+No locals.\r
+#4 0x000000000041f14e in _notmuch_database_link_message (notmuch=0x666240, \r
+ message=0x6833e0, message_file=0x666140) at lib/database.cc:1676\r
+ status = NOTMUCH_STATUS_SUCCESS\r
+ stored_id = {static npos = <optimized out>, \r
+ _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, \r
+ _M_p = 0x7ffff702c3d8 <std::string::_Rep::_S_empty_rep_storage+24> ""}}\r
+ message_id = 0x6832c0 "Tmail"\r
+ thread_id = 0x0\r
+ metadata_key = 0x67ea80 ""\r
+#5 0x000000000041f769 in notmuch_database_add_message (notmuch=0x666240, \r
+ filename=0x666090 "/home/bremner/software/upstream/notmuch/test/tmp.backtrace/mail/msg-001", message_ret=0x7fffffffdee8) at lib/database.cc:1837\r
+ message_file = 0x666140\r
+ message = 0x6833e0\r
+ private_status = NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND\r
+ from = 0x67ee00 "Notmuch Test Suite <test_suite@notmuchmail.org>"\r
+ ret = NOTMUCH_STATUS_SUCCESS\r
+ ret2 = NOTMUCH_STATUS_SUCCESS\r
+ to = 0x67eec0 "Notmuch Test Suite <test_suite@notmuchmail.org>"\r
+ message_id = 0x67eaa0 "\001"\r
+ date = 0x0\r
+ header = 0x67ef10 "<msg-001@notmuch-test-suite>"\r
+ subject = 0x6823c0 "Test message #1"\r
+#6 0x000000000040e91c in add_files (notmuch=0x666240, \r
+ path=0x664a80 "/home/bremner/software/upstream/notmuch/test/tmp.backtrace/mail", state=0x7fffffffe1d0) at notmuch-new.c:507\r
+ dir = 0x0\r
+ entry = 0x665d50\r
+ next = 0x666090 "/home/bremner/software/upstream/notmuch/test/tmp.backtrace/mail/msg-001"\r
+ fs_mtime = 1378426382\r
+ db_mtime = 0\r
+ status = NOTMUCH_STATUS_SUCCESS\r
+ ret = NOTMUCH_STATUS_SUCCESS\r
+ message = 0x0\r
+ fs_entries = 0x6811d0\r
+ i = 2\r
+ num_fs_entries = 4\r
+ entry_type = 32768\r
+ directory = 0x0\r
+ db_files = 0x0\r
+ db_subdirs = 0x0\r
+ stat_time = 1378426382\r
+ st = {st_dev = 65031, st_ino = 3451162, st_nlink = 3, st_mode = 16877, \r
+ st_uid = 1000, st_gid = 1000, __pad0 = 0, st_rdev = 0, st_size = 4096, \r
+ st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1378426382, \r
+ tv_nsec = 0}, st_mtim = {tv_sec = 1378426382, tv_nsec = 0}, st_ctim = {\r
+ tv_sec = 1378426382, tv_nsec = 0}, __unused = {0, 0, 0}}\r
+ is_maildir = 0\r
+ tag = 0x7fffffffe480\r
+#7 0x000000000040fa12 in notmuch_new_command (config=0x661eb0, argc=1, \r
+ argv=0x7fffffffe490) at notmuch-new.c:949\r
+ notmuch = 0x666240\r
+ add_files_state = {output_is_a_tty = 0, verbose = 0, debug = 0, \r
+ new_tags = 0x665ef0, new_tags_length = 2, new_ignore = 0x665fe0, \r
+ new_ignore_length = 0, total_files = 1, processed_files = 1, \r
+ added_messages = 0, removed_messages = 0, renamed_messages = 0, \r
+ tv_start = {tv_sec = 1378426382, tv_usec = 768704}, \r
+ removed_files = 0x681a10, removed_directories = 0x665d30, \r
+ directory_mtimes = 0x665c00, synchronize_flags = 1}\r
+ elapsed = 2.1219957909652723e-314\r
+ tv_now = {tv_sec = 0, tv_usec = 0}\r
+ tv_start = {tv_sec = 0, tv_usec = 140737488348288}\r
+ ret = 0\r
+ st = {st_dev = 4294967295, st_ino = 140737353968080, \r
+ st_nlink = 140737328394192, st_mode = 4160580048, st_uid = 32767, \r
+ st_gid = 160, __pad0 = 0, st_rdev = 67, st_size = 128, st_blksize = 0, \r
+ st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {\r
+ tv_sec = 210453397510, tv_nsec = 472446402651}, st_ctim = {\r
+ tv_sec = 532575944823, tv_nsec = 0}, __unused = {6546568, 0, 6548008}}\r
+ db_path = 0x664a80 "/home/bremner/software/upstream/notmuch/test/tmp.backtrace/mail"\r
+ dot_notmuch_path = 0x0\r
+ action = {__sigaction_handler = {sa_handler = 0x40db03 <handle_sigint>, \r
+ sa_sigaction = 0x40db03 <handle_sigint>}, sa_mask = {__val = {\r
+ 0 <repeats 16 times>}}, sa_flags = 268435456, sa_restorer = 0x0}\r
+ f = 0x7fffffffe480\r
+ opt_index = 1\r
+ i = 32767\r
+ timer_is_active = 0\r
+ no_hooks = 0\r
+ options = {{opt_type = NOTMUCH_OPT_BOOLEAN, output_var = 0x7fffffffe1d4, \r
+ name = 0x432339 "verbose", arg_id = 118, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_BOOLEAN, output_var = 0x7fffffffe1d8, \r
+ name = 0x432341 "debug", arg_id = 100, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_BOOLEAN, output_var = 0x7fffffffe07c, \r
+ name = 0x432347 "no-hooks", arg_id = 110, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_END, output_var = 0x0, name = 0x0, arg_id = 0, \r
+ keywords = 0x0}}\r
+#8 0x000000000040a519 in main (argc=2, argv=0x7fffffffe488) at notmuch.c:303\r
+ local = 0x64b090\r
+ talloc_report = 0x42fcfd <__libc_csu_init+93> "H\203\303\001H9\353u\352H\213\\$\bH\213l$\020L\213d$\030L\213l$ L\213t$(L\213|$0H\203\304\070\303\017\037\200"\r
+ command_name = 0x7fffffffe7d1 "new"\r
+ command = 0x63ee00 <commands+64>\r
+ config_file_name = 0x0\r
+ config = 0x661eb0\r
+ print_help = 0\r
+ print_version = 0\r
+ opt_index = 1\r
+ ret = 0\r
+ options = {{opt_type = NOTMUCH_OPT_BOOLEAN, output_var = 0x7fffffffe354, \r
+ name = 0x4303a7 "help", arg_id = 104, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_BOOLEAN, output_var = 0x7fffffffe350, \r
+ name = 0x430c99 "version", arg_id = 118, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_STRING, output_var = 0x7fffffffe358, \r
+ name = 0x430368 "config", arg_id = 99, keywords = 0x0}, {\r
+ opt_type = NOTMUCH_OPT_END, output_var = 0x0, name = 0x0, arg_id = 0, \r
+ keywords = 0x0}}\r
+(gdb) quit\r
+A debugging session is active.\r
+\r
+ Inferior 1 [process 30499] will be killed.\r
+\r
+Quit anyway? (y or n) [answered Y; input not from terminal]\r
+ FATAL \r
+\r
+Unexpected exit while executing ./backtrace.sh. Exit code 0.\r
+\r
+--=-=-=--\r