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 E5DC04196F2 for ; Fri, 23 Apr 2010 04:22:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 zEFl9yC7+ZsX for ; Fri, 23 Apr 2010 04:22:01 -0700 (PDT) Received: from homiemail-a20.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by olra.theworths.org (Postfix) with ESMTP id 2FB4D431FC1 for ; Fri, 23 Apr 2010 04:22:01 -0700 (PDT) Received: from sspaeth.de (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id 4B9427EC060 for ; Fri, 23 Apr 2010 04:21:59 -0700 (PDT) Received: by sspaeth.de (sSMTP sendmail emulation); Fri, 23 Apr 2010 13:21:56 +0200 From: "Sebastian Spaeth" To: Notmuch development list Subject: Unhandled Xapian exception Date: Fri, 23 Apr 2010 13:21:56 +0200 Message-ID: <87aasul8h7.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Fri, 23 Apr 2010 11:22:02 -0000 Hi Carl, dme complained that my python bindings abort with Xapian::DatabaseModifiedException when doing a Database.find_message('id'). But libnotmuch.so terminates before python has even a chance to catch an execption, and I think it boils down to this: http://git.notmuchmail.org/git/notmuch/blob/ec6d78acf12d5c8fe6d10d091adee6516bf48d8a:/lib/database.cc#l276 find_message() which calls: find_doc_ids_for_term() in lib/database.cc which contains: *begin = notmuch->xapian_db->postlist_begin (term); *end = notmuch->xapian_db->postlist_end (term); without doing any catching. According to Olly Betts this can possibly throw such an exception when the Database has been modified. I propose to try..catch this code block and rather than returning VOID it could return NOTMUCH_STATUS_SUCCESS or NOTMUCH_XAPIAN_EXCEPTION. Not sure how "notmuch_database_find_message" would notify the caller of such an exception situation though. The only possible failure value is NULL (which also means did not find such a message). Sebastian