From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 38D016DE3735 for ; Fri, 16 Mar 2018 11:30:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.168 X-Spam-Level: X-Spam-Status: No, score=0.168 tagged_above=-999 required=5 tests=[AWL=-0.062, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled 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 ZXiU-RTHqu58 for ; Fri, 16 Mar 2018 11:30:48 -0700 (PDT) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by arlo.cworth.org (Postfix) with ESMTPS id CB7F66DE300A for ; Fri, 16 Mar 2018 11:30:43 -0700 (PDT) Received: by mail-wm0-f52.google.com with SMTP id h21so4727317wmd.1 for ; Fri, 16 Mar 2018 11:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WKx6Jkcs1l0GAn1zWs1YTQ5EGeCkJoU4EO53GKUe46Y=; b=YwbWE5+na24g/ZbTMJQcAEcLXwzgFHpPy06CRb26+D+mQlfAItYjU9GnzvLBssVkso 3SntBEsmL1paaAQqUvgwTm6l9k98KpoCCzzlHpVrSz2+bRn5dzh2TMlgjo8G4sqYsjuK +gL0lFSCIrmBNk7DjS8cASzPehveN7Nqu1p3r6yoOTEd++ui4+9JuYDZvnfmfbgOMs/8 eTTzBdD5tNooHawdHGvqRFO1j/UlETQcKg8mldjcPAx5Un6YYPAB8FdMGnfinKg1tRly uwLjiZvhneDWdX3ChXix131KdCAoG9IJcXAl+Kk46CqnkCwZ4ERWCyi1VepmUhJYoUrG q6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :date:message-id:mime-version; bh=WKx6Jkcs1l0GAn1zWs1YTQ5EGeCkJoU4EO53GKUe46Y=; b=sEbDi9fR7eTU4K3p8BOA9jNtpiRGNUj6w4bS1jGos2+LNaY1xPsIqX2vdARvz7OBkn 7YN0DzmfV9/o2L6QKUg1hhVOLuUvkjiwTDFo9NbzQqZ8+I1d76YQXhvHHujWfRNvg6/M LVkeX1lDAjLa5AnlJeSUz8PwSX1KpW4TQ+N+iYLLzznbcnhVclHQGIxd0/zqSClVQ1Uj 7DHJ7QKoqoGH4ATxhzl18A8LnYnNTltlKIbUMxLxhdPKnmcgRbAUkslfHgqd0fcPlFh7 MMYOEzkQt1xdMBq3AqVkNKC9RWyl4y+6ol6sEDtphXTeRLjfryUpw6xeO2SsMCBugDJ+ ipSg== X-Gm-Message-State: AElRT7EGUBtEcu+6xZglvL9YvgQ8UwGav8H5+Syxfbxs57CAOIzFnAr1 vrGIvYZmWS+Z9G+rYhZOJog= X-Google-Smtp-Source: AG47ELvfCRBUbwQ2hjzWeS9mwaONcEX4L7ln/hPYdycaMDkyPA+b9tCoJqhKuWZLm7kRL5hQuVZfPg== X-Received: by 10.80.163.177 with SMTP id s46mr3531602edb.271.1521225039418; Fri, 16 Mar 2018 11:30:39 -0700 (PDT) Received: from devork.be ([2a02:168:5885::b89]) by smtp.gmail.com with ESMTPSA id d18sm1334317edb.68.2018.03.16.11.30.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Mar 2018 11:30:38 -0700 (PDT) Sender: Floris Bruynooghe Received: (nullmailer pid 66788 invoked by uid 469025); Fri, 16 Mar 2018 18:30:37 -0000 From: Floris Bruynooghe To: David Bremner , "W. Trevor King" , Justus Winter <4winter@informatik.uni-hamburg.de> Cc: notmuch@notmuchmail.org Subject: Re: Crash with Python bindings In-Reply-To: <87k1ucp6xb.fsf@tethera.net> References: <5694CA65.8010400@fastmail.net> <20160112102329.4269.20741@thinkbox.jade-hamburg.de> <20160112185107.GA21580@odin.tremily.us> <87k1ucp6xb.fsf@tethera.net> Date: Fri, 16 Mar 2018 19:30:37 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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, 16 Mar 2018 18:30:50 -0000 Hi all, David Bremner writes: > "W. Trevor King" writes: > >> you can avoid the abort (which happens when q.__del__ is called after >> db.__del__). We could make that sort of cleanup easier with context >> managers for Query objects (we have them for databases since [3]), and >> they look like the only object that keep an internal database >> reference: >> >> with Database() as db: >> with Query(db, "*") as q: >> # do something with q >> db.close() >> > > I'm reminded [1] that this problem still exists. If noone has any idea > of a fix, should we document one of the workarounds? This is exactly what I have fixed in my alternative bindings which I created around the end of last year [0]. So we do have an idea of how to fix this, at the time I said I do believe that it's possible to also do this for the existing bindings even though it is a lot of work. After some talking between dkg and me we got to a way forward which proposed this, but I must admit that after messing a little with getting a pytest run integrated into the notmuch test-suite instead of using tox I lost momentum on the project and didn't advance any further. If someone can hook pytest runs with various python versions into the notmuch test suit I'd be very much obliged and probably have another go at this as it's still an interesting problem and gives a nice way forward. Cheers, Floris [0] https://github.com/flub/notmuch/tree/cffi/bindings/python-cffi