unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
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: Tue, 24 May 2022 18:42:35 -0700	[thread overview]
Message-ID: <87bkvmqtf8.fsf@eliza.sh> (raw)
In-Reply-To: <87tu9k9xsg.fsf@tethera.net>

On Fri, May 20 2022 at 09:46 -03, David Bremner <david@tethera.net> wrote:

> Eliza Velasquez <eliza@eliza.sh> writes:
>
>> 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:
>>
> [snip]
>> So I guess `message->modified' isn't correctly initialized, at least
>> according to valgrind.
>>
>> -- 
>> Eliza
>
> Can you see if the following change quiets valgrind?
>
> diff --git a/lib/message.cc b/lib/message.cc
> index 63b216b6..bd3cb5af 100644
> --- a/lib/message.cc
> +++ b/lib/message.cc
> @@ -169,6 +169,7 @@ _notmuch_message_create_for_document (const void *talloc_owner,
>  
>      message->doc = doc;
>      message->termpos = 0;
> +    message->modified = FALSE;
>  
>      return message;
>  }

That seems to have fixed it. Valgrind is very pleased with all of the
test cases now :)

      reply	other threads:[~2022-05-25  1:42 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
2022-05-16 12:01     ` David Bremner
2022-05-20 12:46     ` David Bremner
2022-05-25  1:42       ` Eliza Velasquez [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=87bkvmqtf8.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).