From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eH74ID3nHmpL3C8AWB0awg (envelope-from ) for ; Tue, 02 Jun 2026 10:22:53 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=cBxbv6us; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 75EAC1E0A6; Tue, 02 Jun 2026 10:22:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 33FC01E062 for ; Tue, 02 Jun 2026 10:22:52 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E85F64BA2E1A for ; Tue, 2 Jun 2026 14:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E85F64BA2E1A Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=cBxbv6us Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 4FEE44BA5436 for ; Tue, 2 Jun 2026 14:22:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FEE44BA5436 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4FEE44BA5436 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780410144; cv=none; b=YYbsfTV2JPj3edSRLpWBU0ftOKP7yCQWQIqQWmdxxT5kcRIbjfEqgcc54SXrqx60M63j7zd8w6VSdjqzjPSOXHsaSlRt8hkDATFZbtOqN53Y8yC+UwNItbNpjgkGSzBZXLM6EEehO2xcPfb8COCQnrmfZ7xtMEoswZ+kICaBtMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780410144; c=relaxed/simple; bh=8gCncgvM3+ycqmLM7vXtZNaOr3irmhXLsZTCAcJ0yv8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GZZYxTAzwr8tQCmECvMmBSk7SV/Mn8JA1Af/B5EFxUqWYpgbdCn153ZUkykvPprcyxsa3KRtU1WDdCSmFq/IqRFwiqQO2FQerL/L8QDm8MrfQko7/n7XPv92tuKBKJHPw1q0tN9AupX1WJGnMkeL3mclpClnyYNrIL8Dd1gtceM= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=cBxbv6us reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FEE44BA5436 Received: from eig-obgw-6003b.ext.cloudfilter.net ([10.0.30.175]) by cmsmtp with ESMTPS id UKsGwL1rajgweUQ0dwCoDJ; Tue, 02 Jun 2026 14:22:23 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id UQ0cwMg5X3HCDUQ0cw00PW; Tue, 02 Jun 2026 14:22:22 +0000 X-Authority-Analysis: v=2.4 cv=TOdFS0la c=1 sm=1 tr=0 ts=6a1ee71e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=FelO9ux0wxsA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=RMlsEB6m_M_TtrqdunIA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=D0hF/KTZAzrhgWrnpxqym7k4As1B/TIwr/AZJwQHwmU=; b=cBxbv6usigtvnasoamwVFqz3Nx rLpQksaXEfIvkrV9UKziAXa0yt2KmnSfYafVYkaOm4nTVHv1WUhgOz2dDDBheH4NPdOjqVhsFniyo Ks4/8L6+w0fX33jBb7tuuYomK; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:50830 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wUQ0b-00000004MJ6-37ey; Tue, 02 Jun 2026 08:22:21 -0600 From: Tom Tromey To: Andrew Burgess Cc: Matthieu Longo , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v1] gdb/python: fix memory leak in gdb_py_tp_name In-Reply-To: <87o6hts2q0.fsf@redhat.com> (Andrew Burgess's message of "Tue, 02 Jun 2026 10:36:55 +0100") References: <20260526160459.270322-1-matthieu.longo@arm.com> <87fr3e6sdp.fsf@tromey.com> <11b35b46-7e18-471a-94e2-91fef5b287d2@arm.com> <87tsrr5vtl.fsf@tromey.com> <62841b2c-9d0e-4efc-9b26-ca9bfd8787b9@arm.com> <87ldd35php.fsf@tromey.com> <87zf1ixzc9.fsf@redhat.com> <87cxye5pn0.fsf@tromey.com> <65c7d5c1-37ba-4e49-8d2a-800421075fb2@arm.com> <87o6hts2q0.fsf@redhat.com> X-Attribution: Tom Date: Tue, 02 Jun 2026 08:22:16 -0600 Message-ID: <87fr35hvjb.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wUQ0b-00000004MJ6-37ey X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:50830 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJCE+7OavVoMGeNflGvKrXbJlhAWagAnoeov4ENdnD6BDCgHFgMeIfrA7GP+QLi9SDewGm14k53LWfFz1+otaSI/+jnMO0k4E1BM70OE+0kWP0q1E2DM 9EZ4aB55+evx0DLfNRLMlUTBJrgpzeHZUcQ57GhEj3q6EdHG9DqKK7oJJTfiyHA/RftKX0p/kIh5Uad5mKY1YGqazWmCSYf/1fA= 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 >>>>> "Andrew" == Andrew Burgess writes: >> + const char *s = PyUnicode_AsUTF8AndSize (name, nullptr); >> + if (s == nullptr) >> + return NO_TYPE_NAME; Andrew> If PyUnicode_AsUTF8AndSize fails then a Python exception will be set. Andrew> As we're not going to propagate that back to the actual Python Andrew> interpreter, should we not clear the exception at this point? Andrew> And the same question each time NO_TYPE_NAME is injected instead of an Andrew> error? Also worth noting that normally gdb doesn't simply discard Python exceptions. (To be clear, there are a couple of spots I think, but maybe they are bugs.) Normally either the exception is propagated, standard Python style; or it is displayed using gdbpy_print_stack. This function is used because it respects some user settings that control what is displayed. Tom