--- /dev/null
+Return-Path: <eg@gaute.vetsj.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id D21946DE180F\r
+ for <notmuch@notmuchmail.org>; Mon, 18 Jan 2016 04:45:18 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.474\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.474 tagged_above=-999 required=5 tests=[AWL=0.227,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id u9s4eK6XP4gY for <notmuch@notmuchmail.org>;\r
+ Mon, 18 Jan 2016 04:45:16 -0800 (PST)\r
+Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com\r
+ [209.85.217.176])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 641E26DE17FD\r
+ for <notmuch@notmuchmail.org>; Mon, 18 Jan 2016 04:45:16 -0800 (PST)\r
+Received: by mail-lb0-f176.google.com with SMTP id oh2so346791488lbb.3\r
+ for <notmuch@notmuchmail.org>; Mon, 18 Jan 2016 04:45:16 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623;\r
+ h=date:from:subject:to:references:in-reply-to:user-agent:message-id\r
+ :mime-version:content-type:content-transfer-encoding;\r
+ bh=5RIPm81YJN5IkfS93qM2SKR2k6BhzT8aviQQtD1TUI4=;\r
+ b=X+tbsk40GV6VJ+aPEm4HOvPIBEKJU+NkSYQdPXHTVRaeep7ieBa0KzqrsmHz48kMt1\r
+ vBWYmtjHWG1wxx6jVaPGCjO/RyA7APYC1sfhxabzTy+rVx1NME1adDAZlYJw1eS+plug\r
+ K61+yL/Lb09Y5b8LudCf2bEx+DEjcT4BSj4vGizhPHvWVL3nljnf4+3Oo3tCcKnHjxon\r
+ Jl+WiA1OMKAY9xYM9SA4BH1R9z8YIMScRJjoudYFx/4RQaYCtYZrNtcrTtxWJQId6S3E\r
+ chP7JPzAL4O48dU7AQpdIbYL/nFjL7VeCpT2PYEgMuzD5rry1xonho68LEJRxIT9IrRM\r
+ mmrQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:date:from:subject:to:references:in-reply-to\r
+ :user-agent:message-id:mime-version:content-type\r
+ :content-transfer-encoding;\r
+ bh=5RIPm81YJN5IkfS93qM2SKR2k6BhzT8aviQQtD1TUI4=;\r
+ b=f0wLqCVnW9Q/Y55f3uKE6m2uGTG3ZTBE1JlNZXnv+K0m+xdny78z+bxvbfxvuFxfyA\r
+ UxPkojioyKWP/KcU338ws6zHQQ+PqdDa7nlRUccWkrYlGWfJOQYeL36chyZVhdq2Qg3Z\r
+ 2x18Mo0dsCjNDE/gzGSky6zSsyWc/xWyXr66YdeZbmpjUjcsBsLUmH/bzllyXzSkT4cZ\r
+ CXfTnAP2z0vdDwG3bYf8o+HNiaBpLg2ZHOIb2ldVIdymduDMmZWR8S84vHiHUYoDjsGC\r
+ iKjf+u1EGbMDKu1AP/AH3Qeu8BNEZbKFHipFo6WaRxssykxeVjOj6+XC0rCsJeh1lwnO\r
+ FvXA==\r
+X-Gm-Message-State: ALoCoQnR6/qwHjWqKJIlL9P/fkNBkdj3XqVnW74gkR6maYxEiAbS1ZXqER8YwFNuNHKhPH0abpfi4/Y8x9105A4uxsF6G31cbg==\r
+X-Received: by 10.112.14.102 with SMTP id o6mr8090856lbc.87.1453121114129;\r
+ Mon, 18 Jan 2016 04:45:14 -0800 (PST)\r
+Received: from localhost ([128.39.46.106])\r
+ by smtp.gmail.com with ESMTPSA id nv8sm3159577lbb.7.2016.01.18.04.45.13\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Mon, 18 Jan 2016 04:45:13 -0800 (PST)\r
+Date: Mon, 18 Jan 2016 12:45:12 +0000\r
+From: Gaute Hope <eg@gaute.vetsj.com>\r
+Subject: Re: talloc_abort in notmuch_thread_get_tags () when db has been\r
+ modified\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+References: \r
+In-Reply-To: \r
+User-Agent: astroid/vv0.4-213-g53abb3e2 (https://github.com/gauteh/astroid)\r
+Message-Id: <1453121100-astroid-2-c62fwcrm91-18877@strange>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8; format=flowed\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 18 Jan 2016 12:45:19 -0000\r
+\r
+David Bremner writes on January 18, 2016 13:25:\r
+> The most likely cause of such a crash looks to me like nm_thread is NULL\r
+> or corrupted when passed in to get_tags. It's used without checking as a\r
+> talloc context, and that call to talloc never returns.\r
+>\r
+\r
+Ok, I'll check some further. I am checking whether nm_thread is NULL\r
+though, the preceding code is as follows\r
+(astroid/src/modes/thread_index/thread_index.cc:258):\r
+\r
+```\r
+ for (;\r
+ notmuch_threads_valid (threads);\r
+ notmuch_threads_move_to_next (threads)) {\r
+\r
+ notmuch_thread_t * thread;\r
+ thread =3D notmuch_threads_get (threads);\r
+\r
+ if (thread =3D=3D NULL) {\r
+ log << error << "ti: error: could not get thread." << endl;\r
+ throw database_error ("ti: could not get thread (is NULL)");\r
+ }\r
+\r
+ /* test for revision discarded */\r
+ const char * ti =3D notmuch_thread_get_thread_id (thread);\r
+ if (ti =3D=3D NULL) {\r
+ log << error << "ti: revision discarded, trying to reopen." << endl=\r
+;\r
+ reopen_tries++;\r
+ refresh (all, current_thread + count, false);\r
+ return;\r
+ }\r
+\r
+\r
+ NotmuchThread *t =3D new NotmuchThread (thread); // get_tags is insid=\r
+e here\r
+\r
+ notmuch_thread_destroy (thread);\r
+\r
+```\r
+\r
+(note that there is a bit of code there trying to determine whether the\r
+db is still valid, or needs to be re-opened)\r
+\r
+- g\r
+=\r