From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64233 invoked by alias); 22 May 2018 14:58:36 -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 63892 invoked by uid 89); 22 May 2018 14:58:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1045, realized X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 May 2018 14:58:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 56A56117BCA; Tue, 22 May 2018 10:58:33 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id h7X6XZei730D; Tue, 22 May 2018 10:58:33 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3CAFE117BC8; Tue, 22 May 2018 10:58:33 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 3B74583311; Tue, 22 May 2018 10:58:32 -0400 (EDT) Date: Tue, 22 May 2018 15:48:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning Message-ID: <20180522145832.lfjva34lztffr36y@adacore.com> References: <1526999977-126638-1-git-send-email-brobecker@adacore.com> <87lgcbg2yu.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lgcbg2yu.fsf@tromey.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-05/txt/msg00560.txt.bz2 > Joel> But at the same time, this leads me to believe we may have a weakness > Joel> top.c::execute_command, which installs a cleanup, and "forgets" to > Joel> discard it when C++ exceptions are raised. > > My view was always that dangling cleanups are nearly always bugs; with > the exceptions being functions that either mention "cleanup" in the name > or return a cleanup. Completely agreed. My question is: Should the function catch C++ exceptions in order to take care of the cleanup before re-throwing? Thinking things further, I am realizing that this function is most likely not alone in that situation. So there is no clear reason to be treating that function specifically. > I'm still hoping that we can just remove all cleanups and not have to > deal with the issue any more. Agree on the goal. To say that I am not a fan of cleanups would be an understatement (I used to like them, until I realized how tricky they are to maintain). -- Joel