From: David Bremner <david@tethera.net>
To: "Olivier Taïbi" <oli@olitb.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH] lib/config: don't set destructor until iterator is initialized.
Date: Sat, 31 Oct 2020 14:49:56 -0300 [thread overview]
Message-ID: <87mu02gu9n.fsf@tethera.net> (raw)
In-Reply-To: <20201030001910.939645-1-david@tethera.net>
David Bremner <david@tethera.net> writes:
> As diagnosed by Olivier Taïbi in
> id:20201027100916.emry3k2wujod4xnl@galois.lan, if an exception is
> thrown while the initialization is happening (e.g. if the function is
> called on a closed database), then the destructor is (sometimes)
> invoked on an uninitialized Xapian object.
>
> Solve the problem by moving the setting of the destructor until after
> the placement new successfully completes. It is conceivable this might
> cause a memory leak, but that seems preferable to crashing, and in any
> case, there seems to be nothing better to be done if the
> initialization is failing things are in an undefined state by
> definition.
This one is pushed also. Let me know if it breaks something.
d
prev parent reply other threads:[~2020-10-31 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 10:09 segfault in T590-libconfig notmuch_database_get_config_list: closed db Olivier Taïbi
2020-10-28 11:21 ` David Bremner
2020-10-30 0:19 ` [PATCH] lib/config: don't set destructor until iterator is initialized David Bremner
2020-10-31 17:49 ` David Bremner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mu02gu9n.fsf@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
--cc=oli@olitb.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).