From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99201 invoked by alias); 25 Apr 2019 18:06:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 98976 invoked by uid 89); 25 Apr 2019 18:06:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Google-Smtp-Source:APXvYqzW, destroy X-HELO: mail-wr1-f66.google.com Received: from mail-wr1-f66.google.com (HELO mail-wr1-f66.google.com) (209.85.221.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 18:06:14 +0000 Received: by mail-wr1-f66.google.com with SMTP id r6so665131wrm.4 for ; Thu, 25 Apr 2019 11:06:13 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:4c97:6d52:2cea:997b? ([2001:8a0:f913:f700:4c97:6d52:2cea:997b]) by smtp.gmail.com with ESMTPSA id o16sm3942767wro.63.2019.04.25.11.06.10 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 11:06:11 -0700 (PDT) Subject: Re: [PATCH 5/5] Fix memory leak in exception code To: Tom Tromey , gdb-patches@sourceware.org References: <20190425165256.31226-1-tromey@adacore.com> <20190425165256.31226-6-tromey@adacore.com> From: Pedro Alves Message-ID: <30e99361-c252-53e2-ec7c-5a6bc7301a3f@redhat.com> Date: Thu, 25 Apr 2019 18:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190425165256.31226-6-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-04/txt/msg00543.txt.bz2 On 4/25/19 5:52 PM, Tom Tromey wrote: > PR gdb/24475 concerns a memory leak coming from gdb's exception > handling code. > > The leak occurs because throw_exception_sjlj does not arrange to > destroy the exception object it is passed. However, because > gdb_exception has a destructor, it's undefined to longjmp in this > situation. > > This patch fixes the problem by avoiding the need to run any > destructors in gdb_rl_callback_handler, by making the gdb_exception > "static". > Why fix it like this, instead of fixing it like in the guile patch? I'd think you could even use a common POD type for both guile and here? Thanks, Pedro Alves