From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OULHBsQnAWv2biYAWB0awg (envelope-from ) for ; Sat, 21 Nov 2026 00:10:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1795237827; bh=GZTYYvjzas/61JfEy/WaHCxNty4eKBmKpuhn6+dvSvg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I416q5tFHIk6wgnYB8tdlm1WgvVcLPfPHZMCaAqyXN1TVDoQWS0NdgeRQV5ev8Tcr CHw/r2ce+xNW9aSzRdMzO5r9OVhnWm7k8sYD9T8dpvFe1xt9BdFQeOHjRk57FXOIYb xYRyX6kYvtSKgw3N21TmPQnny8CjOfG4v1AC2f4I= Received: by simark.ca (Postfix, from userid 112) id EDB761E0CE; Sat, 21 Nov 2026 00:10:27 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=GArFwOIv; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1E6F71E052 for ; Sat, 21 Nov 2026 00:10:27 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3BCE44AA29BE for ; Sat, 21 Nov 2026 05:10:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BCE44AA29BE Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=GArFwOIv Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 024994410DE4 for ; Sat, 21 Nov 2026 05:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 024994410DE4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 024994410DE4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795237802; cv=none; b=vlbYXL82BlUS2WYMVpTVkjkyeAYeI8UxQ/NXKukJkBEu4DBa9DNf5L5qOJoYG21AK7wSLOvTC+5DhxLWryIPVYuBW40+K0CG6aUIfBEPCWhoyWf92gAyrcs2k0oeNF3ykaAO80EUuvuEoqMWUDfsN7jv17hJlSHuA6w+XcuqHF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795237802; c=relaxed/simple; bh=GZTYYvjzas/61JfEy/WaHCxNty4eKBmKpuhn6+dvSvg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=oW59cYqKrq6FTd8Ij3pYRbGp972OjvJE0lDMhDyFP+TTGye9E7ly7C+DT4+nAm3aOI5vzhMtrBGfVrozk4YxWK5Gs4jRjWKF+IFXNamAO/O2cXRFFbF5psWv8XBIIvA+buoVI/PImGUtzTTKhNf/Eiyp24el/GwVrDpRQt937DM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=GArFwOIv DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 024994410DE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1795237800; bh=GZTYYvjzas/61JfEy/WaHCxNty4eKBmKpuhn6+dvSvg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GArFwOIvuAWKFhXR5SFaoGZA44ANRN9NUYIkWiPIOg1JWlF9RYLiIxwhKbVQXhXTP cuSLWn8GR4g/xOqqKxDF+pJVDy1CT180VoKsSFNrCrHEyeLQYhjU1Q1v63m030VnpY xbQBtCNVRExKR6Jwq1gjePGs0sGXi8/j60X5KG44= Received: by simark.ca (Postfix) id AEA071E052; Sat, 21 Nov 2026 00:09:59 -0500 (EST) Message-ID: <2ad6424e-4ad0-4a3d-9d9a-8c5eff3a9fb0@simark.ca> Date: Sat, 21 Nov 2026 00:09:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] gdb: fix out-of-bounds span in append_composite_type_field_raw To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20261120201510.3162938-1-simon.marchi@efficios.com> <20261120201510.3162938-2-simon.marchi@efficios.com> <87h5hbxkns.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87h5hbxkns.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 11/20/26 4:22 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Fix it by reallocating the array before incrementing the number of > Simon> fields. > > Thanks. > > Simon> There are more such existing problems uncovered when using std::span, > Simon> but this is the most obvious and blocking one. > > Ugh, sorry. I will try to get to fixing these. No worries. Not your fault in either case. Here are two I know: $ make check TESTS="gdb.base/gcore.exp" (gdb) core /home/smarchi/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/gcore/gcore.test [New LWP 3444629 (id 1)] /usr/include/c++/16/span:186: In function: constexpr std::span<_Type, _Extent>::span(_It, size_type) [with _It = const unsigned char*; _Type = const unsigned char; long unsigned int _Extent = 18446744073709551615; size_type = long unsigned int] Error: function requires a valid iterator range [first, first + count). and $ make check TESTS="gdb.dwarf2/bitfield-parent-optimized-out.exp" p var.bitfield /usr/include/c++/16/span:186: In function: constexpr std::span<_Type, _Extent>::span(_It, size_type) [with _It = unsigned char*; _Type = unsigned char; long unsigned int _Extent = 18446744073709551615; size_type = long unsigned int] Error: function requires a valid iterator range [first, first + count). Ideally we would also improve gdb::span's asserts to match std::span's asserts. > Approved-By: Tom Tromey Pushed both, thanks. Simon