From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) (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 212973C2E for ; Sat, 25 Jul 2026 17:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784999176; cv=none; b=A/1eehnnf2zSreF0FCxFm0vH9vpqvDm7a0hVPUP7CkM9M6OpMmBDphGCB6j7ZGWyziCoVMkDWGJOaMoCMIwbL/EGrNdvLrXF6Hus4SYvGL75/u5CKG8ZJYdtly58YLkIYJQ8LWc3AqzYjMyE5W1ow6U71DhDwR3VClo/NWhAVDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784999176; c=relaxed/simple; bh=44RMZpWE/2HBiTTCP2FJNJ4evoLZSfT6tkAK2Ybu5iM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=vDHzabhDXRkW9Cr8zJxFgL9qno5EIlWdXV7e+tNGeqiZH+Af3t96jh4fnVwA0v6G4SstvxY3VGS0MEmK0I0pLBapyb1Y9vKelr5uebnGuAoFQyzO2ZQkxEDUJ1NIWCSGrWLPpsfhE/lXVpcJ5qyZRhoOxsFJmqspsnvYP0Oi66A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=viMEtYUZ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JcVncrM0; arc=none smtp.client-ip=103.168.172.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="viMEtYUZ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JcVncrM0" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 05330EC00BE; Sat, 25 Jul 2026 13:06:14 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-06.internal (MEProxy); Sat, 25 Jul 2026 13:06:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; 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=fm1; t=1784999174; x=1785085574; bh=uQcoT9M2Yp AYN9F2WS8/RfWIN+O5VxdiiWi0gGWcEGA=; b=viMEtYUZT7ScUpFlJSL3falXh7 UhFuWvivnaNPXW2rl8t+kkDnBbFIozcUvoPb70CGaXpdwGeLRKJqLqCewEew5GHz 53ZubuzE4z8lyNIEOukfPp2mksfUIkaiMHn71TBwHWgQtJdEgdZLfbw/EFeyLlVD zwgqObtn4RQL4pyg7ieq/Wj2g8KEJXDOcXfZkQOgYYitVD25Ubn22IO74bsTfy0t bNlEgVJffZI2Hc5gvzCiMeqgVKfGtkHwdndr8aBGoIAIOExSHDSItwMmbyrEGNuP xKqwQsRfodl9sBYs6SR8dSfVd9RB6+LkYW1EUXOHhZsg3NhxeDdPUIpe4mpw== 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=fm2; t= 1784999174; x=1785085574; bh=uQcoT9M2YpAYN9F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Av70l7GNCX5skPzKEvkcb1ZOMhgG9g X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Jul 2026 13:06:13 -0400 (EDT) From: Junio C Hamano To: Jeff King Cc: git@vger.kernel.org Subject: Re: [PATCH v2] remote: plug memory leaks In-Reply-To: <20260725161819.GA2343104@coredump.intra.peff.net> (Jeff King's message of "Sat, 25 Jul 2026 12:18:19 -0400") References: <20260725161819.GA2343104@coredump.intra.peff.net> Date: Sat, 25 Jul 2026 10:06:12 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jeff King writes: > We should not rely on that assumption, because we sometimes discard the > configset (e.g., when discovering the repo, or when writing a new config > option). I couldn't come up with a case that fails, but I think it is > mostly luck (or lack of imagination) that there is no code path that > invalidates the configset between when we read the remote config and > when we actually use it. > > So even though in something like: > > git -c url.$PWD.insteadOf=$PWD clone $PWD dst > > we end up with a state were the instead-of structs are broken, nobody is > reading them at that point. > > So I think this v2 is doing the right thing. Thanks. I had somebody else dig into the entire codebase and they claim that there is only one existing (ab)user of the configuration API that assumes that the configset-held strings will stay forever, which is the comment_line_string stuff that is stored from the configuration callback without getting copied. I do not necessarily believe it is the only one, but this particular code indeed seems to rely on the assumption. #leftoverbits perhaps.