From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 304 invoked by alias); 4 Apr 2002 11:17:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32487 invoked from network); 4 Apr 2002 11:16:53 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 4 Apr 2002 11:16:53 -0000 Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id F3AD61E702; Thu, 4 Apr 2002 13:16:49 +0200 (MEST) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f To: Michael Snyder Cc: Hilfinger@cs.berkeley.edu, Don Howard , gdb-patches@sources.redhat.com Subject: Re: [RFA] Avoid recursivly defined user functions. References: <200204032236.OAA20235@tully.CS.Berkeley.EDU> <3CAB9346.724C11BB@redhat.com> X-Yow: I left my WALLET in the BATHROOM!! From: Andreas Schwab Date: Thu, 04 Apr 2002 03:17:00 -0000 In-Reply-To: <3CAB9346.724C11BB@redhat.com> (Michael Snyder's message of "Wed, 03 Apr 2002 15:41:58 -0800") Message-ID: User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (ia64-suse-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-04/txt/msg00107.txt.bz2 Michael Snyder writes: |> Paul Hilfinger wrote: |> > |> > > Executing a recursively defined user function results in a core-dump from |> > > gdb: |> > |> > ... |> > |> > > The following patch catches recursive user function definitions and |> > > disallowes them: |> > |> > Is the segmentation fault the result of stack overflow? |> |> Yes it is. |> |> > If so, I |> > point out that there is an 'if' statement, so recursive commands are |> > not necessarily wrong, are they? |> |> No they're not. So it's a judgement call. Is it more important |> to allow recursive macros, or to prevent GDB from dumping core? |> We're basically running an interpreter here... |> |> I guess one thing we could do would be to impose an arbitrary |> (possibly user-settable) stack depth limit. That's more work, |> of course... The simple minded check in Don's patch won't catch many cases of infinite recursion anyway (mutual recursion, command invocation with arguments). Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."