From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cH+xLBOQBWIDBgEAgWs5BA (envelope-from ) for ; Thu, 10 Feb 2022 23:22:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ENxmJROQBWIpRwAAG6o9tA (envelope-from ) for ; Thu, 10 Feb 2022 23:22:11 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 130AA32EBC for ; Thu, 10 Feb 2022 23:22:11 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7F77A5F716; Thu, 10 Feb 2022 22:22:08 +0000 (UTC) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by mail.notmuchmail.org (Postfix) with ESMTPS id 5189D5F402 for ; Thu, 10 Feb 2022 22:22:05 +0000 (UTC) Received: by mail-pj1-x1033.google.com with SMTP id d9-20020a17090a498900b001b8bb1d00e7so6986687pjh.3 for ; Thu, 10 Feb 2022 14:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FFe+hqOGdTTIBHrB6Hld737kSY4CgV9FzbIewD3VWzo=; b=iLiyDA4v3mivOKQBU2L35COBZO+72ht1Eon90Ki+ZS3GSh1+gTcFfod4W0G5hCBfGM NoIZms6d7cpZDGfheEbwvR1jvA6FGTOVjWucjO55AZNKB7ZPO1vR86tlVxNjGl3zAWr6 2tcjlf5C69oWpO1bX8tcAllKrKpyI+i9cjO6IpcanPb80I6Jr8uHU5UKpEdWWffLZnB0 mVhtOk6+cXty4PCwj9E/Q7iXxcpDmLgojJnKO1UrDG2bFMekH4C634OlGKH7is5ClYbg DiZpJzHh2xizOrG1JJSxsGTGsxkj/E9HH6p2a39/Bn+uGvJ1IgOL120biicM6cqB18cO mTLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FFe+hqOGdTTIBHrB6Hld737kSY4CgV9FzbIewD3VWzo=; b=lebRPU2qfhgbN62MxdCZaGRlbs5FddLQ2Z3J9rDdilhLKU+ZegErrqWIaCDk1qeOyg whhnYsTMLfUMcYWSM0WpAr8UmnrRe85H4ol4zD6jNrhBRzcGnlVAHjeDkeHLw3YjnUgG 7xM4bTutit0zdtIYELBPNeFBH1FbH+ocTBNFmOP9VfaVrLw4Yshq5e6Krxvrrrozv+m9 QkCPs/x3vgmlrqFJjBLW0M9JNMSeWNXYueo+akYXoo8CF2bkeF9ZtLW94qIr+M0sWffs MnaiblraaHXWNNk5tkl0YGgFoy9TtDMRhTShkwraqQXp6nIwA2NhjGJcbclOUPRzsNUv +x2A== X-Gm-Message-State: AOAM530fzx69Z9eoc9Ni9QmcU5XM7QwhG+faPGeMf/mIcnLyEm8cF/Yf zH79yAJI850KKVW6BD+e1HJGV6WIl3I= X-Google-Smtp-Source: ABdhPJxGxrupRYU5NlIHzdTHUEayAMcCv6xCFmeJXhtNDcvLQUNwcnE48YFhp08MvYgFatXzKOZwXg== X-Received: by 2002:a17:902:a5c1:: with SMTP id t1mr9468659plq.106.1644531723247; Thu, 10 Feb 2022 14:22:03 -0800 (PST) Received: from localhost (167-179-176-76.a7b3b0.bne.nbn.aussiebb.net. [167.179.176.76]) by smtp.gmail.com with ESMTPSA id o1sm26905485pfu.88.2022.02.10.14.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 14:22:02 -0800 (PST) Date: Fri, 11 Feb 2022 08:21:58 +1000 From: Austin Lund To: notmuch@notmuchmail.org Subject: Re: Python binding SIGABRT/SIGSEGV Message-ID: <20220210222158.b3ym5m63he4ob3k5@sarek.home.aplund.id.au> References: <164447257269.144855.18033927138350290920@sarek.home.aplund.id.au> <164449516783.6325.11211773003514272352.github@grubix.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <164449516783.6325.11211773003514272352.github@grubix.eu> Message-ID-Hash: 43FFVIGXWUPJ7TD23KCCOOW3VABCDU3E X-Message-ID-Hash: 43FFVIGXWUPJ7TD23KCCOOW3VABCDU3E X-MailFrom: austin.lund@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 CC: Michael J Gruber X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644531731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Z2QsSjHHYtDGVd3S6CPHfcV85xu668yA2qd/JOiNbAo=; b=GKsmgjDOoYir1RbEWiG0NClYhAGdzpUf33kCmRQuQzEJkQR47E7xSn3NI+mft4OGg0iOeL 7txRIv+S5FZN6/VO3M219l/5uknnNNMiSifDhAaaxGx6C/yvjsI+CB34Al6+5QkpRPu6eU LWTaV8VusZ2p/ZdhyJmZpGxouY8Lf6hzvjQpygEMsMbNh4XJL6Bq7rdzbfT61wi7anpklg l5Yr1CB1PlzfE3RpYVwYLs/B03vZ0dCb37qRlsL9Ekb+4Rt0aCgB5/BrGjID6dpIV1dwM/ +bn//3SFN2Q5IdmsjejgFoRXu3T47NYZoZvDYpk+t2nmU59XZIccNbjcfKRYkg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644531731; a=rsa-sha256; cv=none; b=hZ4PRmLZbOiYFxq53v5OVfYC0SsWVh+5TP5hK7dx35JWRjWZd2UQmEGzsEAQOwXslrNb5J AlMzDRDPd/ndWEBrEpcXzwC3WxN8wH+cCbZASrARIW/tfINvn5PvdmQBlIvuc+duV3jKGp Id+KupM29GUr6bqUg6M1q7h0jBP3XrsviSp+bUae0R1bhx3WgCBmfajQ8RoVcfKiXPXfFW HJuRM8JMoPZW27zs3vlnE59locvc2+lfQjdJeuqv6D8ag9M3k1oSEputX29rXglz53qAd5 d3O0LrdhVFI9ujEsBgiRZCdvZAA7uMJ8O8/G/aE2T6kh2THMyu9U2KdhvKfM0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=iLiyDA4v; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=iLiyDA4v; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 130AA32EBC X-Spam-Score: -1.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: +lyullDF57qF On Thu, Feb 10, 2022 at 01:12:47PM +0100, Michael J Gruber wrote: > Austin Lund venit, vidit, dixit 2022-02-10 06:56:12: > > I'm clearly doing this python code wrong by not using the iterator correctly: > > > > > import notmuch2 > > > > > > d = notmuch2.Database() > > > m = list(d.messages("since:today")) > > > p = m[0].path > > > print(p) > > > > But I seem to be getting a SIGABRT instead of a python stack trace. Is > > this the expected behaviour? > > You didn't expect it :) > > And this can be confusing. d.messages() returns an iterator through > Message objects whose lifetime depends on the iterator. In contrast, > thread.get_messages() returns on iterator through OwnedMessage objects > whose lifetime depends on the thread. I guess I didn't say it explicitly, but I would 'expect' the python interpreter to raise an exception rather than having an unhandled exception terminate the program. Perhaps raising a MemoryError or ReferenceError or some other exception would be better than an unhandled SIGABRT.