From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 64/pN5aJjWKaQwEAbAwnHQ (envelope-from ) for ; Wed, 25 May 2022 03:42:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IKr6NZaJjWL0ZAEAG6o9tA (envelope-from ) for ; Wed, 25 May 2022 03:42:46 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0E70A1EA1D for ; Wed, 25 May 2022 03:42:45 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B41455F70D; Wed, 25 May 2022 01:42:42 +0000 (UTC) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by mail.notmuchmail.org (Postfix) with ESMTPS id AC6B65F6DA for ; Wed, 25 May 2022 01:42:39 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 46E662B01513; Tue, 24 May 2022 21:42:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 24 May 2022 21:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eliza.sh; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1653442956; x=1653446556; bh=AlT8j/ekWW kghGox9dn5Bi3V7GOoRU9vFGzpUXQy+hI=; b=uqxxZ0RhjhdALfvxRhnR1iNE2H y2lVdsDC/+g4yViJkigdQp+OZxKpVd6dpl9LzNCQNjnvHiz/Ak5Gt2zxlt1xLrAB 9DKPxdkx+Ox5AaFJvo+qRvt73cdaudn8RWqXFdrbifM7T+pdnoEYoBQpWAnYj6rR tqtqxvtSh5T9BH4+syVAwgJKJ1PmDYDUknsTfZO4z6GeSoh01asH3Fhjru1p1s3A C2X1O88WRHpqskX46+RlrCrAN5HUOl2JQiv+3hJJ3GC1oDwZ7GF4leWrWaCc0OV7 gEEVGKhIwle7ryjIXwNIdFo7zXYjZRHqfUyAhR3M6m/LOtiAQvgS0m1+HO1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1653442956; x=1653446556; bh=AlT8j/ekWWkghGox9dn5Bi3V7GOo RU9vFGzpUXQy+hI=; b=Yw5wcprBlA63L5Z7OCbKhIvTcmCqDpJIeGoQn55/KIqP bu6So1iwrHKikytdqrv6qjNYhdkPNAPjjOjeFQifC5prn34WmvGqyxhoGU+SobFZ 0pzJI42dx0sQKCZsRgsBwF61xpMekaRoHiFjI9SfxEkX5UjaVwKTeQyZQ8EzI+vX UNumhPqUjetIjic3FBbtz6F+Y8kdws68Lam8ThA0CKJid7ZvFDxbc8HT6lhsg757 413I1sd4htkQElXlRYh7vMwOcHS+uGa3f/0D+3t3MSLgFZQnna1u5K6g/6A5DS3c IE1vP5Tuxij3DA2fuKkK4L5/sSkmDsdL7z8Lj7jl0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeeggdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefglhhiiigrucgg vghlrghsqhhuvgiiuceovghlihiirgesvghlihiirgdrshhhqeenucggtffrrghtthgvrh hnpeelgeeggedttddufedtudeltdethfdtgeevkeekleettdejvdejkeefjeetkeefgeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvlhhiii grsegvlhhiiigrrdhshh X-ME-Proxy: Feedback-ID: i87c446d8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 May 2022 21:42:36 -0400 (EDT) From: Eliza Velasquez To: David Bremner , notmuch@notmuchmail.org Subject: Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync In-Reply-To: <87tu9k9xsg.fsf@tethera.net> References: <87o7zxj086.fsf@eliza.sh> <87lev1x0zy.fsf@tethera.net> <87k0aliuen.fsf@eliza.sh> <87tu9k9xsg.fsf@tethera.net> Date: Tue, 24 May 2022 18:42:35 -0700 Message-ID: <87bkvmqtf8.fsf@eliza.sh> MIME-Version: 1.0 Message-ID-Hash: SQE53ACLNN4BXZ5LZ4TBJJS7PNRYZ4JS X-Message-ID-Hash: SQE53ACLNN4BXZ5LZ4TBJJS7PNRYZ4JS X-MailFrom: eliza@eliza.sh X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653442966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=AQuLSCp2bnCWi79rhTcNF82JKKK168IPZ8VB6CgdrHM=; b=jcefKLoUgOw0KuGe4TOZMueYqw3oUqTPvUbVBORmFrv7N/BhQnYmE+4Q7c+VJq8z4DDGth toX4+r/YUdFAzD8f9kHzyg+phLL5N2rlpjVDZa3TgHTXW2+/MzCUqhNkgVcOtNBYb1TU1c hjFQ1arBjdNm7UJ4XMCjso9np0lLkPUnfOeweHtTiCUCtcRbvD2NJXJLifpjkM5EaIPwd2 5Vk+YgVRITzWHEiIgvWKgvzboS6XooN/+jLgEn4y4Bo1r/IImQx3K2C7YVXTdidljlo5Rw IyPNkZ2DRvxBMAVvuhFL2Q7CToThr5Agi//KLf8IqOrFdC9reDHW7FdKNnI/TQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653442966; a=rsa-sha256; cv=none; b=dLVAhdTIwjXPIoHmsrceX2+mypZoUb6+DvXKz0H8kZY38jG4Bjal22A0xbO3ZP23raX2wF 2fRN5fD5RbNBJT3B3jNrv+AmP/DdcK1I6ANakMFnUlDjgpjAlJ1Z0+5DiaGbpAbkTGHD9A 6rSKKLEamyZylCaBBR13KlzCT6SyxhfEeWyjEQxEIkz7ymKq9JJZXmhHXycTkZihI3EXph GQazIn86fo2I+B6sXk8CA6LS4prEk3zsHSSvp3lO6VVSRUx6N3GvkE4Tihnm8WvfQBfkmS 6dv1XPUSwWvr/tPebuzfZ16/2oFSZ2Flju6BFt4uOk74FxGAlbcHqQz+Q2HoPQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eliza.sh header.s=fm1 header.b=uqxxZ0Rh; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=Yw5wcprB; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 1.38 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eliza.sh header.s=fm1 header.b=uqxxZ0Rh; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b=Yw5wcprB; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 0E70A1EA1D X-Spam-Score: 1.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2pd6xzcGUwO/ On Fri, May 20 2022 at 09:46 -03, David Bremner wrote: > Eliza Velasquez writes: > >> On Mon, May 16 2022 at 06:47 -03, David Bremner 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 :)