From nobody Fri Jun  7 18:35:25 2024
X-Original-To: standards@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VwqdB0z2mz5M2NT
	for <standards@mlmmj.nyi.freebsd.org>; Fri, 07 Jun 2024 18:35:26 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4Vwqd94KD5z3wcp
	for <standards@FreeBSD.org>; Fri,  7 Jun 2024 18:35:25 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717785325; a=rsa-sha256; cv=none;
	b=k2r//3WCPl1cQku63+xhAL1SgBEzNHU3MLwll7zmiN1LniqRo66IopGu/VFSnRHgmt+vup
	dMbdwH/e1bsEYGVBivT/2mQyS+m3a9UnaezYehah1wO4ZvyzFO4lPVCIBwPdAFLPxb7XeV
	Qb2JPep6CSHx1LaOCq1QRB6YXQLl3wt5eMGVRbpi+oTby0Xl2OeHtkXma13zAg2EMUnTWB
	dMdcEJSNQO8ogYt/e0f4IGcppHuTvoEI3WoDT5/2+TiOau0uW8VOqmothKr+oKTFbvE3//
	gAlpKeB/EsgmCqhgQmonecCkXzzhTpxCDZAHMJpjfVoJyZ3TaDEWXqK3iTFlmg==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1717785325;
	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;
	bh=kAm5MdhFSvmBS9Mh371fG9MZ6HL99zt0q3IGyNEM+10=;
	b=ID/psamjxLi3241j4+AlhtN1/1VK8M7pODs96sdY+Aqd6BF1hgHXeUCW45IGcwbuTNXHh7
	SJ/kD5w2/czinrXcpdxNxNoi3at1ZNjXMy4YlM4Un6BiiVVNfel+h928G/tD2144g2Ybnk
	u0a82zVpYdmKiUPx/sWlGPM2HCVtdJtu1F4DboiDMV+aNHAXNp+gonwYPl36mPYneLgCu8
	EQpMurSd8biSW/9q7L193+dNAbOD08d/qDUXQkVAjiUyk6QeO8+lyAejd0WkQ9XFK0reLw
	qno8X8adM+e6JxiAtisEi0gHzTCDAmeU+DJ6wgcV/1E7rshoqJUl5AnZ/yd2bw==
Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vwqd93nYyzQ5p
	for <standards@FreeBSD.org>; Fri,  7 Jun 2024 18:35:25 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org ([127.0.1.5])
	by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 457IZPXY049189
	for <standards@FreeBSD.org>; Fri, 7 Jun 2024 18:35:25 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 457IZPw6049188
	for standards@FreeBSD.org; Fri, 7 Jun 2024 18:35:25 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
From: bugzilla-noreply@freebsd.org
To: standards@FreeBSD.org
Subject: [Bug 279560] FreeBSD 14.1 ships libc++ which passes wrong size to
 sized operator delete
Date: Fri, 07 Jun 2024 18:35:25 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: standards
X-Bugzilla-Version: 14.0-RELEASE
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: Affects Many People
X-Bugzilla-Who: dim@FreeBSD.org
X-Bugzilla-Status: New
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: standards@FreeBSD.org
X-Bugzilla-Flags: 
X-Bugzilla-Changed-Fields: 
Message-ID: <bug-279560-99-vDvQrXEqHP@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-279560-99@https.bugs.freebsd.org/bugzilla/>
References: <bug-279560-99@https.bugs.freebsd.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Id: Standards compliance <freebsd-standards.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-standards
List-Help: <mailto:standards+help@freebsd.org>
List-Post: <mailto:standards@freebsd.org>
List-Subscribe: <mailto:standards+subscribe@freebsd.org>
List-Unsubscribe: <mailto:standards+unsubscribe@freebsd.org>
X-BeenThere: freebsd-standards@freebsd.org
Sender: owner-freebsd-standards@FreeBSD.org
MIME-Version: 1.0

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279560

--- Comment #3 from Dimitry Andric <dim@FreeBSD.org> ---
This is a bit of a false positive due to internal details of libc++
std::string.

Normally the size of a std::string is 24 bytes on amd64, but only if it
contains a 'short' string. When the contained string is too long to fit in =
the
object itself, it's reallocated on the heap instead.

In this particular case some TCMalloc test string comes out as 25 bytes, and
that is what libc++ eventually calls malloc() with. However due to internal
administration issues, it calculates the wrong size for the corresponding
delete.

This was also noticed by AddressSanitizer after
<https://github.com/llvm/llvm-project/pull/83774> ("Enable sized deallocati=
on
by default in C++14 onwards"), and fixed by Vitaly Buka in
<https://github.com/llvm/llvm-project/commit/d129ea8d2fa3>.

I will merge that fix into -CURRENT, with one prerequisite fix added, so we=
 can
see if there's any fallout (but it's not likely). Then I will MFC it, and we
can think about a 14.1 erratum.

--=20
You are receiving this mail because:
You are the assignee for the bug.=