From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 ODpxOraNh2I0ZgAAbAwnHQ (envelope-from ) for ; Fri, 20 May 2022 14:46: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 mp11.migadu.com with LMTPS id +P5LOraNh2LONAAA9RJhRA (envelope-from ) for ; Fri, 20 May 2022 14:46:46 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 AB3FF1B584 for ; Fri, 20 May 2022 14:46:46 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id D20135F775; Fri, 20 May 2022 12:46:43 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id D2AB75F6DA for ; Fri, 20 May 2022 12:46:41 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id C70F75FC0D; Fri, 20 May 2022 08:46:40 -0400 (EDT) Received: (nullmailer pid 1895386 invoked by uid 1000); Fri, 20 May 2022 12:46:39 -0000 From: David Bremner To: Eliza Velasquez , notmuch@notmuchmail.org Subject: Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync In-Reply-To: <87k0aliuen.fsf@eliza.sh> References: <87o7zxj086.fsf@eliza.sh> <87lev1x0zy.fsf@tethera.net> <87k0aliuen.fsf@eliza.sh> X-List-To: notmuch Date: Fri, 20 May 2022 09:46:39 -0300 Message-ID: <87tu9k9xsg.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: J3O7HH2HGVWBW5RU4WW5LD6TEAUII4Y4 X-Message-ID-Hash: J3O7HH2HGVWBW5RU4WW5LD6TEAUII4Y4 X-MailFrom: david@tethera.net 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=1653050806; 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; bh=KI6T3FRwWA1sLsGJo+e7hsEXfh9sGX5QJcADuC7avAc=; b=HdNZO1N+v4vg/vjsi57khj9cLgP6nP5gReOV/nk6shQWEic1XmN+VC3w0HQwVY8jNhRig1 13xdVhnblcV8/ZEE9sR/bDpM4IkTM/h4219HqG1m4ExP61GhY+Cw/vThsM8CMUuCbOnvGf J92P5q+w+9m/hMXdobUYxlRjJ94D5gNyH9hawkiQGAzeAaWmXpG4K2YLuu11Ic1Y4SEH8P Qk/8BSxTsp/k39so8485P2TezZpbYS+d0sgaNx55lyyaFFhvDKrLur00TCCvrJenLgY/Zp EaLh4RD25lyF0g0XpgzPWpWTyhf4GTKx2DnTT8Fh9OzKz68KW9PukPKehKYpPw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653050806; a=rsa-sha256; cv=none; b=siPAvU/s2wAgyMsKRtGYOBb+2ZqCiqm/HVWkeTfLUsFLe94GuA+9X6OVEellFwg2huaNap 5nXjnIiKoe6KT7nOPQKN2mTvUpfJWUh4at8O/TlOhkyZ8g+ZK0ZyKvIjblAU4fpsX/grOF X77JUq77yITc4VK7j82zth9SRslvX9RUI+SXpmkoF57enHMGGY/Jd/ceFlcxl62ALdaomE n7TFYAEWoCt/fVCl9rmnxfpXanjfTpxwPDD6qiLUhWlPsHjohzZcf6RSXf+HYnXrlTDTUz E9g4oKsarl5pqe4/RgZlcGfyPTxxOqinYUVk7fU8sfBErhvZnc8Aphdr2QgR3Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: AB3FF1B584 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0/zNxfb7Gima 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; }