From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10043 invoked by alias); 3 Apr 2002 23:53:25 -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 10030 invoked from network); 3 Apr 2002 23:53:23 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 3 Apr 2002 23:53:23 -0000 Received: from redhat.com (notinuse.cygnus.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA00343; Wed, 3 Apr 2002 15:53:19 -0800 (PST) Message-ID: <3CAB9346.724C11BB@redhat.com> Date: Wed, 03 Apr 2002 15:53:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Hilfinger@cs.berkeley.edu CC: Don Howard , gdb-patches@sources.redhat.com Subject: Re: [RFA] Avoid recursivly defined user functions. References: <200204032236.OAA20235@tully.CS.Berkeley.EDU> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg00081.txt.bz2 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... Michael