From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OCUbAKq+7mHJ0AAAgWs5BA (envelope-from ) for ; Mon, 24 Jan 2022 15:58:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WAMrOKm+7mEADgEAauVa8A (envelope-from ) for ; Mon, 24 Jan 2022 15:58:49 +0100 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 53F6139F37 for ; Mon, 24 Jan 2022 15:58:49 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ECA305F6CF; Mon, 24 Jan 2022 14:58:46 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7C7C35E022 for ; Mon, 24 Jan 2022 14:58:44 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id DE5CA5FC01; Mon, 24 Jan 2022 09:58:43 -0500 (EST) Received: (nullmailer pid 2309743 invoked by uid 1000); Mon, 24 Jan 2022 14:58:42 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: Memory leak in notmuch_database_destroy() In-Reply-To: <20220105224538.m36lnjn7rf3ieonc@athena> References: <20220105224538.m36lnjn7rf3ieonc@athena> Date: Mon, 24 Jan 2022 10:58:42 -0400 Message-ID: <87wnipch99.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 75VD6JAGPNUWTYPQZ62QNNQ2F3Q5IWRC X-Message-ID-Hash: 75VD6JAGPNUWTYPQZ62QNNQ2F3Q5IWRC 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-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643036329; 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=iaKSZRe64qyDyVPGJa6B0Eaxuy4ru9GjrOW8cQ9I9F4=; b=aGINLW/occGirMyTod35Bp90r5QSHdVxmAZKmCNDWplp90oVbz9ZIEAQFj2IKlHF2oQ0I/ +9xh91q4HTKnYkM8AylevrlL+sFu5CPCLCHLdMSSicc3QAnWk8zBq7vlDFslhuYNcyJdK1 seUFPpQcrciP9O/4/5DsqyWzYUw6B8+1bsRYDPQgQfJNXTVszHa2/60XA45gCGnvRcQXfA NrfdGGO1lGK2p+cglJV20zwiBZT4BWgjnDBg5qP8dIyxFiRH5ksk+lFAfHfC6+xoZQtHak iXyH0pbNoojjiYQoJh97yA/VwJC0jzPH9JmIqJtug4+GUxsFFRrR/pWfvIhfkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643036329; a=rsa-sha256; cv=none; b=XloJEgaIh3Igs5Vq58RDEiaDIuK8vNWpII6b6XSmbz+tlvt/3G4wvOtLpxEXkaSXzzNrwf ipff129/mCuMKBVgWySMUm0q65Fkf0oPLZJLB0SXp3TXZeKqMkQZ0zVof04bmYtwkPSKQu xx+CErcuGCFyLls/IOZcwRlNz4l+TsJAb+CdFtV2xYruzcvOJWXHAhdSOrq3/HoYzETaD2 JDu4ix3PaHncgLzRKRcR+G4Mw/TkKYOKbV0MGFfmpowDXAlbPfNbqYg6WZsJGAvWlpenrP nh8C2AJ1Ed5M4NwMie+vGrfTTPOB8jhVtSdKqVEPJJcxFqvyD4d/VCmIfojBWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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: -2.84 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 53F6139F37 X-Spam-Score: -2.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: yHmJw6kUXyVS Austin Ray writes: > Hi, > > libnotmuch 5.5.0 (notmuch 0.34.2) leaks memory when opening a database > with 'notmuch_database_open_with_config()' and cleaning it up with > 'notmuch_database_destroy()'. I've included a reproducer program (based > on an existing notmuch test) and ASAN output below. > > Replacing 'notmuch_database_destroy()' with 'notmuch_database_close()' > or omitting the database clean-up entirely resolves all but the first > ASAN entry. There's no leak if 'notmuch_database_open_with_config()' > returns an error. > > Thanks! > > Austin In id:20220122205416.nbxqdcapjab62iln@athena Austin confirmed these leaks were fixed as of 2786aa4d548d28579c761e9358d44c84dfb29068