On Mon, May 16 2022 at 06:47 -03, David Bremner <da...@tethera.net> wrote:

> Ideally of course I'd like a reproducer in C.  It would help to have
> line numbers in the valgrind output. It might be enough you install the
> notmuch debug symbols?

Took me a while to figure out the debugging workflow in NixOS, but I
managed to capture the line numbers. At messsage.cc:1333, at the second
condition below:

--8<---------------cut here---------------start------------->8---
/* Synchronize changes made to message->doc out into the database. */
_notmuch_message_sync (notmuch_message_t *message)
    if (_notmuch_database_mode (message->notmuch) == 

    if (! message->modified)

--8<---------------cut here---------------end--------------->8---

It becomes very clear why this error only happens when removing a
non-existent tag if you look at at message.cc:1570...

--8<---------------cut here---------------start------------->8---
    try {
        message->doc.remove_term (term);
        message->modified = true;
    } catch (const Xapian::InvalidArgumentError) {
        /* We'll let the philosophers try to wrestle with the
         * question of whether failing to remove that which was not
         * there in the first place is failure. For us, we'll silently
         * consider it all good. */
--8<---------------cut here---------------end--------------->8---

So I guess `message->modified' isn't correctly initialized, at least
according to valgrind.

notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org

Reply via email to