From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qBYzBKEV+V7kTAAA0tVLHw (envelope-from ) for ; Sun, 28 Jun 2020 22:11:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aCoEAKEV+V5FLAAAB5/wlQ (envelope-from ) for ; Sun, 28 Jun 2020 22:11:45 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3F6309404D9 for ; Sun, 28 Jun 2020 22:11:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C2F8B6DE13DE; Sun, 28 Jun 2020 15:11:37 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KTwLn_0FBSUq; Sun, 28 Jun 2020 15:11:37 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id D2EB46DE13D3; Sun, 28 Jun 2020 15:11:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 31B366DE13D3 for ; Sun, 28 Jun 2020 15:11:35 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iA3BohYMt0FY for ; Sun, 28 Jun 2020 15:11:33 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTP id C46246DE13C8 for ; Sun, 28 Jun 2020 15:11:33 -0700 (PDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 19F5E61417; Sun, 28 Jun 2020 18:11:33 -0400 (EDT) Received: (nullmailer pid 1972379 invoked by uid 1000); Sun, 28 Jun 2020 22:11:31 -0000 From: David Bremner To: Floris Bruynooghe , notmuch@notmuchmail.org Subject: Re: Usage after database close In-Reply-To: <875zbazzlu.fsf@powell.devork.be> References: <87d05je1j6.fsf@powell.devork.be> <87d05jkvry.fsf@tethera.net> <875zbazzlu.fsf@powell.devork.be> Date: Sun, 28 Jun 2020 19:11:31 -0300 Message-ID: <87a70mlu24.fsf@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -1.01 X-TUID: 4GlSRTqFLerw Floris Bruynooghe writes: > > Ok, I forgot the "expected behaviour" part of the bug report ;) I think > that this doesn't work is fine and I'm not surprised by and your > description of fetching it first is very reasonable. However I was > expecting NOTMUCH_STATUS_XAPIAN_EXEPTION instead of bluntly getting > terminated. This is what the notmuch_database_close() docs say after > all. Sure, uncaught exceptions are never nice. > > I had a little look and this seems to be caused by the > message->doc.termlist_begin() call in > _notmuch_message_ensure_metadata(), I guess almost every Xapian API call will fail with the database closed. > I didn't have xapian debug symbols and am not familiar with xapian to > quickly have an idea of whether this case can be improved or not. > (-dbg debian packages for notmuch and xapian would be very handy ;)) > You need to add a seperate repo for the new style debug symbols in Debian: $ (git)-[master]-% apt policy libxapian30-dbgsym libxapian30-dbgsym: Installed: 1.4.15-1 Candidate: 1.4.15-1 Version table: *** 1.4.15-1 500 500 http://debug.mirrors.debian.org/debian-debug testing-debug/main amd64 Packages 500 http://debug.mirrors.debian.org/debian-debug unstable-debug/main amd64 Packages 100 /var/lib/dpkg/status > But part of my question is, *should* this be improved? Am I > interpreting notmuch's intended API correctly? Well, I agree you should get NOTMUCH_STATUS_XAPIAN_EXCEPTION back, or we should change the docs to say "just don't do that". d