From: Eliza Velasquez <eliza@eliza.sh>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync
Date: Mon, 16 May 2022 04:33:36 -0700 [thread overview]
Message-ID: <87k0aliuen.fsf@eliza.sh> (raw)
In-Reply-To: <87lev1x0zy.fsf@tethera.net>
On Mon, May 16 2022 at 06:47 -03, David Bremner <david@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. */
void
_notmuch_message_sync (notmuch_message_t *message)
{
if (_notmuch_database_mode (message->notmuch) == NOTMUCH_DATABASE_MODE_READ_ONLY)
return;
if (! message->modified)
return;
...
}
--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.
--
Eliza
next prev parent reply other threads:[~2022-05-16 11:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 9:27 [bug] possible condition depending on uninitialized value in _notmuch_message_sync Eliza Velasquez
2022-05-16 9:47 ` David Bremner
2022-05-16 11:33 ` Eliza Velasquez [this message]
2022-05-16 12:01 ` David Bremner
2022-05-20 12:46 ` David Bremner
2022-05-25 1:42 ` Eliza Velasquez
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=87k0aliuen.fsf@eliza.sh \
--to=eliza@eliza.sh \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/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).