From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CN/wHZk2gmLGawAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 13:33:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MMz5HZk2gmK22QAA9RJhRA (envelope-from ) for ; Mon, 16 May 2022 13:33:45 +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 49C753E1A4 for ; Mon, 16 May 2022 13:33:44 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CDB2C5F73C; Mon, 16 May 2022 11:33:41 +0000 (UTC) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2C8A45F6B7 for ; Mon, 16 May 2022 11:33:39 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id D702C580199; Mon, 16 May 2022 07:33:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 16 May 2022 07:33: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=1652700817; x=1652704417; bh=TUfdFeOGbv jF7g5IruUU3cEaABQqXTCSdh8CwrhMGb4=; b=l8b8ciJZMLIwiUkFJsfzxj6mZn 9CtUPffnnsgZaSkkpaxm70FoOAdVXu6CWaC3eUcE3HB59KJ72F88gwcKB0Wc1OHb /YVZFb1uXSApM4vk5sxtljYhTYvz3Z7bczO6sz0y9CCmziK/1SXaYuYItdyy3nwN dw9SEiasMcdhSCkANst2yikmtlNnFeuNZoTRw7r8ECqxR2IPNgX/WQkydflCezVW iJtvBklRScO0hqcTx8TDPtm2uio6tFy95RfnLcKY6l2lBqbcu7L8DDNeJ5L5Rypi 52s2zfBnIaU734U8dcUOzngerYjoFVODuC0mh/ZhIOO4ur3QyaVVh8H0U9wg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652700817; x= 1652704417; bh=TUfdFeOGbvjF7g5IruUU3cEaABQqXTCSdh8CwrhMGb4=; b=u CSJiIoGd7NygC2dmiFdc4hudDLTiqYm7qZv3H90qZ0QFzhmT3Z4m+gaQ2JF4q7e7 wxXN5ULAIbcHmYJesyxIa3wzf/2ozqezx2V1tNxskdjK9M8KZvPi/9DE2+a4gjV1 jmrjPc5ZYCeiJQ/jpxm5157oUv6EZdPApjJPsGVKalthwTqrLyJpGTb8aoesQ5sK cmSZEpNaRXI8d8bZED/iaXpG5bMnojy3BhEa07mb7ipVmLOhQ2WwFedXUGfT5qNe vOXM6lDwCz3lEWtTTHjsFssdspzBzczD6L9Jm0armOWeIhOx3ikN+hwdIET3++HH yl7N9rFLz8jwqtuD6Ma7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheehgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefglhhiiigrucgg vghlrghsqhhuvgiiuceovghlihiirgesvghlihiirgdrshhhqeenucggtffrrghtthgvrh hnpeelgeeggedttddufedtudeltdethfdtgeevkeekleettdejvdejkeefjeetkeefgeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvlhhiii grsegvlhhiiigrrdhshh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 May 2022 07:33:37 -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: <87lev1x0zy.fsf@tethera.net> References: <87o7zxj086.fsf@eliza.sh> <87lev1x0zy.fsf@tethera.net> Date: Mon, 16 May 2022 04:33:36 -0700 Message-ID: <87k0aliuen.fsf@eliza.sh> MIME-Version: 1.0 Message-ID-Hash: FTOALJUTH7BXGQOBUBLY5ERLBS6SFC7Y X-Message-ID-Hash: FTOALJUTH7BXGQOBUBLY5ERLBS6SFC7Y 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=1652700825; 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=EkTpYe0AZX54Yuz3XNAM//HpOr//QZ6LYvb252n8aiQ=; b=afRct2/b5qXQz3ph3AlYB97sHVZ2U+IQnxJWZg3cY4wNvuLXRD591XU3c1uTmUhtigFHpY qakkL1IVyYv2CeZgp0ql2llE3qyE3ZRJaAyB2PR6gpiJevGVIwmj/9M1y7tb5nn9TzTY8A U72j/ZkyTnS23ZaQOQm3qcEGB+0XXt264LG439k9PgTmw+q0stWri/Jz5BiHExKSjrrTIJ wurMk4QMI4x1LaodjHnA4/ehDpc7j9GENGtwHXFeAaDtCxdeZFOhv3W0MOzI/V+tsseun5 +429K0MZ7SwrogjAwMggs6a6s0A4SD/LVQkcpdgNpGA9EetRa2aNGyyNWW16uQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652700825; a=rsa-sha256; cv=none; b=UgsEqt9AYDaU34x8iiX8qzV5HMSq9DLucR94ABR08oyMLp3quNCNQv6tq1zpdrTs8429GD i8xnf5XpHyCndbRzexsqEL3lcFX3wBY2XUQsfODmYkuQss8GIQ37+gMdtentStxpE8rFBZ WDrGkcqypMCMsvSzekztoyW+dJbabGfA81CzQTOSpXbkGYMRTYRpaD2nlIB8ZvrZ11mZth XHqwHiAEmQlQiJbOCn41j645tInhaGOfAVgHE+shkXkENm5db0vfN8xOatxZ22mbcAZ3NA 1LjzCRYGHCU1mYKQfXaBUMVvMOrLngHFNVHaNjbK/jy/uCxT2DlrpQJEZpU8IA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eliza.sh header.s=fm1 header.b=l8b8ciJZ; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="u CSJiIo"; 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: 1.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=eliza.sh header.s=fm1 header.b=l8b8ciJZ; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm1 header.b="u CSJiIo"; 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: 49C753E1A4 X-Spam-Score: 1.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: vTVmpNFcUOev 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: --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