Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync

Subject: Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync

Date: Tue, 24 May 2022 18:42:35 -0700

To: David Bremner, notmuch@notmuchmail.org

Cc:

From: Eliza Velasquez


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 :)
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: