--- /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 15913431FBC\r
+ for <notmuch@notmuchmail.org>; Fri, 24 Jan 2014 17:41:04 -0800 (PST)\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 UL0ALQj985QT for <notmuch@notmuchmail.org>;\r
+ Fri, 24 Jan 2014 17:40:56 -0800 (PST)\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 15ACF431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 24 Jan 2014 17:40:56 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1W6sEt-00077P-QF; Fri, 24 Jan 2014 21:40:51 -0400\r
+Received: (nullmailer pid 32053 invoked by uid 1000); Sat, 25 Jan 2014\r
+ 01:40:48 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Justus Winter <4winter@informatik.uni-hamburg.de>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types\r
+In-Reply-To: <20140124163302.2392.83892@thinkbox.jade-hamburg.de>\r
+References:\r
+ <1318198374-926-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+ <1318198374-926-2-git-send-email-4winter@informatik.uni-hamburg.de>\r
+ <4eddf2b1.4288980a.0b74.5557@mx.google.com> <87fwgx7vmm.fsf@SSpaeth.de>\r
+ <E1RYMoW-0004Sc-R1@thinkbox.jade-hamburg.de> <87r47xpli0.fsf@zancas.localnet>\r
+ <20140124163302.2392.83892@thinkbox.jade-hamburg.de>\r
+User-Agent: Notmuch/0.17+35~g3b36898 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Fri, 24 Jan 2014 21:40:48 -0400\r
+Message-ID: <87ppngon33.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Sat, 25 Jan 2014 01:41:04 -0000\r
+\r
+Justus Winter <4winter@informatik.uni-hamburg.de> writes:\r
+\r
+> #0 0x00007f996ad021d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56\r
+> 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.\r
+> (gdb) bt\r
+> #0 0x00007f996ad021d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56\r
+> #1 0x00007f996ad05388 in __GI_abort () at abort.c:90\r
+> #2 0x00007f99699d4486 in talloc_abort (reason=0x7f99699db648 "Bad talloc magic value - access after free") at ../talloc.c:317\r
+> #3 0x00007f99699d8097 in talloc_abort_access_after_free () at ../talloc.c:336\r
+\r
+> This is a bit contrived b/c I'm destroying the db object by\r
+> hand. Never the less libnotmuch calls abort, and there is no way to\r
+> contain something like this in the python bindings.\r
+\r
+FWIW libnotmuch is not directly calling abort here, talloc is, because\r
+it is detecting illegal memory access patterns. So there could well be a\r
+libnotmuch bug here, but it isn't really related to error handling.\r
+\r
+As far as I can tell, the underlying reason for the crash is that that\r
+talloc is a hierarchical memory allocator, and the directory is a child\r
+of the database. This "ownership" should probably be documented in the\r
+header for notmuch_database_get_directory. This won't fix your crash, of\r
+course ;).\r
+\r
+d\r
+\r
+\r