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 6EC876DE0A89 for ; Sun, 19 Nov 2017 15:11:49 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 FMfvoRE3nerN for ; Sun, 19 Nov 2017 15:11:48 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 9BD786DE0297 for ; Sun, 19 Nov 2017 15:11:48 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1eGYka-0007mk-CO; Sun, 19 Nov 2017 18:11:44 -0500 Received: (nullmailer pid 22032 invoked by uid 1000); Sun, 19 Nov 2017 23:11:42 -0000 From: David Bremner To: Gaute Hope , notmuch@notmuchmail.org Subject: Re: python bindings memory management In-Reply-To: <1511105729.sleqpkzaf0.astroid@strange.none> References: <1511105729.sleqpkzaf0.astroid@strange.none> Date: Sun, 19 Nov 2017 19:11:42 -0400 Message-ID: <87lgj17tjl.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Sun, 19 Nov 2017 23:11:49 -0000 Gaute Hope writes: > Hi, > > when writing this small script [0][1] using the notmuch python bindings I > had to manually delete the python objects in the right order. Otherwise > it segfaults when exiting, presumably because memory dependencies / > cleanup isn't done correctly when the Python GC gets going. Essentially > I have to delete the objects in the order of their dependency: Assuming this is python > 3.3, it sounds related to id:5694CA65.8010400@fastmail.net See in particular id:20160112185107.GA21580@odin.tremily.us