From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AWQeFPB0+mhT2wQAWB0awg (envelope-from ) for ; Thu, 23 Oct 2025 14:33:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1761244400; bh=g2fBbz+Qp/8miTtebZgwyYR66EYiZe85SoXR22D2uyc=; h=Date:Subject:From:To:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hRZgQBQ2bz0rO0PX6sSRCa5rIRZ6nuNsbV8mMbXg3vGGqAoUHi6ZOpnN0yq6THSmh woAezYeoqt00Lp3lmP5oiGoAI6vMiH7BVDORZ2FxTphQ7xuBH5QWj8W+Hs1tMVU1Mi aQhHmne23YNsV+WFfGsNfzYznEZ/eIJ5LcnoX0gg= Received: by simark.ca (Postfix, from userid 112) id 4E3681E04C; Thu, 23 Oct 2025 14:33:20 -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 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=JjfOIsF4; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 DF86E1E04C for ; Thu, 23 Oct 2025 14:33:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76D89385829B for ; Thu, 23 Oct 2025 18:33:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76D89385829B 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=JjfOIsF4 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 797FB3858434 for ; Thu, 23 Oct 2025 18:32:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 797FB3858434 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 797FB3858434 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761244339; cv=none; b=xKU3iWfoIi+kbmYecI/LHZhq5XwJt42EnAaXeWdqZCFd9i+QYoTjCIK3fNd+wRlKbIQ02GeqeqQSSkB01BL53VnqfBR0QDV4qLfDW45zyZynEgfPOVPXF1hxW5lDjf4JWOsuQ+nzKQiBLmy3ykT09LPQGJ2ZPuRxpdqzj1p2jUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761244339; c=relaxed/simple; bh=g2fBbz+Qp/8miTtebZgwyYR66EYiZe85SoXR22D2uyc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=SbUnwGnu8G6VkRfH0yhSFQ9Ag0vWLK+2ML0oqh6If2GQ8/wFDDdvYX2S1zFwQ1htf1KL5A4XDVLVHMJfWGlQc/Sns52ElrxxIiPaHX1zg0IiVLlXOB1fPGHHu3WTHPxPG81nHmtWY4cluqus9RisJNBJRDMQf36VFX0mFoh+6HA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 797FB3858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1761244339; bh=g2fBbz+Qp/8miTtebZgwyYR66EYiZe85SoXR22D2uyc=; h=Date:Subject:From:To:References:In-Reply-To:From; b=JjfOIsF4i3gWo4MEvQ62iNEE2U9AfNIAWsvqth2Mkxap14uRix6uC64HIBfQGokz/ Znez9L/SlYl25KBzkd3B8H8q+xlC3c19v4SdmH7QX4XtHpPUmrMwnobJzO3VkNboQ8 cg04VzaCv3KEVBNPKjYY/vYF76LEYZ0VHXZ+Z5YY= Received: by simark.ca (Postfix) id E23DA1E04C; Thu, 23 Oct 2025 14:32:18 -0400 (EDT) Message-ID: <9266c5a7-bf78-4c48-af1a-56a362093d11@simark.ca> Date: Thu, 23 Oct 2025 14:32:18 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] Two bug fixes in mdict_free From: Simon Marchi To: Tom Tromey , gdb-patches@sourceware.org References: <20251023-mdict-free-v1-0-ad02b2bdd549@tromey.com> <20251023-mdict-free-v1-1-ad02b2bdd549@tromey.com> <4c83ffce-598b-4712-9b98-45728d52b4d0@simark.ca> Content-Language: fr In-Reply-To: <4c83ffce-598b-4712-9b98-45728d52b4d0@simark.ca> 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 10/23/25 2:26 PM, Simon Marchi wrote: > On 10/23/25 1:17 PM, Tom Tromey wrote: >> A heap-allocated multidictionary should be freed by calling >> mdict_free. However, while this function does free the contents of >> the dictionary, it neglects to free the dictionary itself. >> >> There's also a second bug, which is that if a multidictionary is >> created with no dictionaries, gdb will crash on the first line of >> mdict_free: >> >> enum dict_type type = mdict->dictionaries[0]->vector->type; >> >> So, this patch also adds the type to struct multidictionary, avoiding >> this problem. Note that this does not increase the structure size on >> x86-64, because the new member fits into the padding. > > I think you could just remove dict_vector::type and use > multidictionary::type at the single spot where dict_vector::type is > still used. > > Simon Btw, your change LGTM with or without my suggestion. Approved-By: Simon Marchi Simon