From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eec/IUGCz2qU7QgAWB0awg (envelope-from ) for ; Wed, 14 Oct 2026 09:23:13 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=DGe9QXyV; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6CAE31E04E; Wed, 14 Oct 2026 09:23:13 -0400 (EDT) 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 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 C61FE1E04E for ; Wed, 14 Oct 2026 09:23:12 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DD624BA23EC for ; Wed, 14 Oct 2026 13:23:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DD624BA23EC Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=DGe9QXyV Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id CFA304BA23CE for ; Wed, 14 Oct 2026 13:22:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CFA304BA23CE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CFA304BA23CE Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791984167; cv=none; b=sKMTcpfymMafM2FAaJf0xSMg+I3VHeZeaA8IKOeLt9ZVrzrlrqwd3eCS0IwNjmFmdfJT1kPExrlpfevrvjnFTQJOOnWwxc2ZhjqkC+bWjlz6BeliSfdCQzkhYVuO/2hlqP75+28VX/lUQph2k0P5sQv6qt8MP9w7viP1d+xJizw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791984167; c=relaxed/simple; bh=sYkoKmvC4wIyK+39mqprcH3TLZI7JhGt72mTW72Vdf0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=C72iVWgCWWa4lVcaeAzU2kteCH/ojj6BvJTFrkEVRbNinRT6/3QoDBolq5Dk2A4mGjqXGgbyGSGabNlUTnIv3W+d4HHrJI3DlFcYfOC29MsG7me4N5hAo0U0WnFWWldm0oMe96pSXbAEKf4r2X7kxkwaPL9ccInSUlvgsjVr84Q= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=DGe9QXyV DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFA304BA23CE Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 69EDMeXh146569 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Oct 2026 09:22:45 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 69EDMeXh146569 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1791984166; bh=LZqWN0RUvNo0u/jVdN+a3NhbdoAyObB/xfSJQPnLGNg=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=DGe9QXyVFP6Ato/NvTixioRFnkqSahne1pOjAfqFg1n/zE3VIT0vCczxM6ymedOxz Tr5wmqFPIJj1MR3thXeKmXf1RK7Z8iFsnLKFAegl4yHqVrVjF/gyDI5b4KTR0ZSJqO c6PQFCdqil2Kxyoya7Z5M7KYZX1i6sTViKpY1+inp1ARbtKyIcnwJUtNG1zMamMKCE RPBWSWuAdjUKgduDA1UUATWeJCaCp01xkcp1eKDuko+Dgv6lpI35Rwm4q2eXhSdVin hhfFLQUipIH/TjcWDJAMHXnqCgO7/lkUplj4gxedfqLTXRcHAXAkco2ABO9wLvvUq9 bt7b6ryjRcW8g== Received: by simark.ca (Postfix) id B537B1E04E; Wed, 14 Oct 2026 09:22:40 -0400 (EDT) Message-ID: <201008ac-55a5-4811-98dc-07c187251d65@polymtl.ca> Date: Wed, 14 Oct 2026 09:22:40 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] gdb/dwarf: fix crash when .gdb_index contains Rust legacy mangled names To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20261005052602.1288766-1-simon.marchi@polymtl.ca> <20261005052602.1288766-3-simon.marchi@polymtl.ca> <874ieo5tcc.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <874ieo5tcc.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 14 Oct 2026 13:22:41 +0000 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 10/14/26 9:01 AM, Tom Tromey wrote: >>>>>> "Simon" == simon marchi writes: > > Simon> Since this name does not match the C++ and Ada special cases, it falls into > Simon> the DOT_STYLE else: > Simon> components = split_name (name, split_style::DOT_STYLE); > Simon> Because of the consecutive dots in the symbol name, `components` (an > Simon> std::vector) contains some empty components. Some code > Simon> later calls .back() on one of those empty string_views, which is invalid. > > It seems to me that a "dot-style" name could never have two consecutive > dots. So, how about changing split_name to bail out in this case? Yes it would make sense to do the check directly in split_name, instead of doing it in just one caller. I'll make a v2 for that, but do you think patches 1 and 2 could go in as-is? > I see I didn't write any unit tests for split-name.c, which seems like a > real oversight. > > Simon> I can't think of a pretty way to fix this. Since we don't have a flag that > Simon> tells us whether a name is a linkage name or not, we can only make some > Simon> educated guesses. > > Yeah. I think we've resisted doing this. But maybe we should just give > in and look for a leading _Z/_R. But that would could false positives, right? Like if I have classes _Zebra or _Random. Simon