Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 15913431FBC for ; Fri, 24 Jan 2014 17:41:04 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UL0ALQj985QT for ; Fri, 24 Jan 2014 17:40:56 -0800 (PST) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 15ACF431FB6 for ; Fri, 24 Jan 2014 17:40:56 -0800 (PST) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1W6sEt-00077P-QF; Fri, 24 Jan 2014 21:40:51 -0400 Received: (nullmailer pid 32053 invoked by uid 1000); Sat, 25 Jan 2014 01:40:48 -0000 From: David Bremner To: Justus Winter <4winter@informatik.uni-hamburg.de>, notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types In-Reply-To: <20140124163302.2392.83892@thinkbox.jade-hamburg.de> References: <1318198374-926-1-git-send-email-4winter@informatik.uni-hamburg.de> <1318198374-926-2-git-send-email-4winter@informatik.uni-hamburg.de> <4eddf2b1.4288980a.0b74.5557@mx.google.com> <87fwgx7vmm.fsf@SSpaeth.de> <87r47xpli0.fsf@zancas.localnet> <20140124163302.2392.83892@thinkbox.jade-hamburg.de> User-Agent: Notmuch/0.17+35~g3b36898 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 24 Jan 2014 21:40:48 -0400 Message-ID: <87ppngon33.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jan 2014 01:41:04 -0000 Justus Winter <4winter@informatik.uni-hamburg.de> writes: > #0 0x00007f996ad021d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 > 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. > (gdb) bt > #0 0x00007f996ad021d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 > #1 0x00007f996ad05388 in __GI_abort () at abort.c:90 > #2 0x00007f99699d4486 in talloc_abort (reason=0x7f99699db648 "Bad talloc magic value - access after free") at ../talloc.c:317 > #3 0x00007f99699d8097 in talloc_abort_access_after_free () at ../talloc.c:336 > This is a bit contrived b/c I'm destroying the db object by > hand. Never the less libnotmuch calls abort, and there is no way to > contain something like this in the python bindings. FWIW libnotmuch is not directly calling abort here, talloc is, because it is detecting illegal memory access patterns. So there could well be a libnotmuch bug here, but it isn't really related to error handling. As far as I can tell, the underlying reason for the crash is that that talloc is a hierarchical memory allocator, and the directory is a child of the database. This "ownership" should probably be documented in the header for notmuch_database_get_directory. This won't fix your crash, of course ;). d