From patchwork Tue Nov 5 06:17:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13862376 Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7864E1FEFC4 for ; Tue, 5 Nov 2024 06:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730787471; cv=none; b=ALOMC/wjuCRwcXeGHYnXlemmh3u8IYkd1mvITlo7bk9hWEGHr7QUeh2+FHKU0wpdZt5AWsdIhPAGvK19Hkg7jBeomzGwIW4L33BpfR7C6ZC6RTtsWpTlIlhwJF0JYDVH6ZYh/uSMFDnnn0KQE/IDmmu40AwT+kESQOT5uaJqq1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730787471; c=relaxed/simple; bh=9W+Pz6dnSsy23sDEAOr4cW8Osu48nJcCMbjFtpG8nFU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AcmUd7eK6kUZymBZHoueNauSPiReKGQZ/l0T719KjzpJbbLGC5+KFShF3BNgqCbsJ/7lsfDZNSs2OyhR8k/ElJRWCxRoWgnI/KG8h+bVT7R5J9N2sBQGZS8Q+xN5PTDvi//ehHp7x2VZF0jTaKBD3QyCMGe9v4nK5soSERzsfDM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=rpVpwMvv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=iWOReNov; arc=none smtp.client-ip=202.12.124.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="rpVpwMvv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iWOReNov" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 8E898114018C; Tue, 5 Nov 2024 01:17:49 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 05 Nov 2024 01:17:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1730787469; x=1730873869; bh=5r31irX9YM rLTNDAIG8DiiB98K9BFZ66pjq//sCZSOk=; b=rpVpwMvvmJzMfAfgoaYYZo1UPb 4GV/EPu8JnkT3rztmmhbBCJYoutULO8bDXx+pwlMcjnyt2E2DF1L5QKMwzSBZC4Q yd5/mg7p8osVSL/J+bRYsAPmHDA+6pOfZbnR9MjzcGBPLpgLXyD+zTdG0w046U/R X3qzDeqAjWx6yXgrP6EVb8IjQZJ8vu0DT/VdeiJ52cTO0tdq1GnqnVUF4VLc/Pru kxbfiYciSNhdSGXtcXd5sprPBbOfzwQ4wJmdMiwE+2FfZs84fbnqsW55fLBPDadr cTwVEgyZuEa+5yha8c8FtONvY9sGzwtJJxjLRbaLzJsD2EebWAibE6FJNgqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1730787469; x=1730873869; bh=5r31irX9YMrLTNDAIG8DiiB98K9BFZ66pjq //sCZSOk=; b=iWOReNovvqi+ntP3XNV/Flupmz9nJK9k4FAyKr/Ai2hiY42nIKV XPnHAGJ7/6YGqa/VGpWZPgUNoZz6klJq6qS9jCeahHYFUub1H5+kNDwBlCk47e3r 4z7z5+S5AU+19fVuPe/PUbH0UxwzVAPT12S72C1tL+Ji8ZNWF7YxcZ95dVlPtttC 1nkNK8Cfu5s+zb8NrTcPsXFu8erB2+YkzA2tBlIB+SZl6h6ypOggerT7UAx3oeCJ eEyU/IqK/RkLb4sZpc7TFvF1IBSNeTelOPEl6TeF051NqllxQSQEXUTezVevS4rk OFljGwrG9WbmU5lR/gVrRPyS3ZklHbxVGfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeljedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohephedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepkhhrihhsthhofhhfvghrhhgruhhgshgsrghkkhesfh grshhtmhgrihhlrdgtohhmpdhrtghpthhtohepjhhlthhosghlvghrsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtthhopehtoh honhesihhothgtlhdrtghomhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghl rdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Nov 2024 01:17:48 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d5c94d2e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 5 Nov 2024 06:17:26 +0000 (UTC) Date: Tue, 5 Nov 2024 07:17:40 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Toon Claes , Kristoffer Haugsbakk , Justin Tobler Subject: [PATCH v3 18/22] t/helper: stop re-initialization of `the_repository` Message-ID: <70f16486d77ec69874ee4f36cc1d89631deae3fd.1730786196.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: While "common-main.c" already initializes `the_repository` for us, we do so a second time in the "read-cache" test helper. This causes a memory leak because the old repository's contents isn't released. Stop calling `initialize_repository()` to plug this leak. Signed-off-by: Patrick Steinhardt --- t/helper/test-read-cache.c | 2 -- t/t7519-status-fsmonitor.sh | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c index d285c656bd3..e277dde8e71 100644 --- a/t/helper/test-read-cache.c +++ b/t/helper/test-read-cache.c @@ -11,8 +11,6 @@ int cmd__read_cache(int argc, const char **argv) int i, cnt = 1; const char *name = NULL; - initialize_repository(the_repository); - if (argc > 1 && skip_prefix(argv[1], "--print-and-refresh=", &name)) { argc--; argv++; diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh index 7ee69ecdd4a..0f88a58a819 100755 --- a/t/t7519-status-fsmonitor.sh +++ b/t/t7519-status-fsmonitor.sh @@ -2,6 +2,7 @@ test_description='git status with file system watcher' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh # Note, after "git reset --hard HEAD" no extensions exist other than 'TREE'