From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6389 invoked by alias); 1 Jun 2010 16:48:23 -0000 Received: (qmail 6380 invoked by uid 22791); 1 Jun 2010 16:48:20 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Jun 2010 16:48:14 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51GmCvQ031890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Jun 2010 12:48:12 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51Gm9Oe007059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 1 Jun 2010 12:48:11 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o51Gm9fq023243 for ; Tue, 1 Jun 2010 18:48:09 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o51Gm9rO023242 for gdb-patches@sourceware.org; Tue, 1 Jun 2010 18:48:09 +0200 Date: Tue, 01 Jun 2010 16:48:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [rfc patch] nomem: internal_error -> error Message-ID: <20100601164808.GA22487@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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 X-SW-Source: 2010-06/txt/msg00005.txt.bz2 Hi, unfortunately I see this problem reproducible only with the archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]). OTOH this branch I hopefully submit in some form for FSF GDB later. In this case (a general problem but tested for example on Fedora 13 i686): int main (int argc, char **argv) { char a[argc]; return a[0]; } (gdb) start (gdb) print a ../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes. It is apparently because boundary for the variable `a' is not initialized there. Users notice it due to Eclipse-CDT trying to automatically display all the local variables on each step. Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. But is anone aware of the reasons to use internal_error there? I find simple error as a perfectly reasonable there. (history only tracks it since the initial import) IIRC this idea has been discussed with Tom Tromey, not sure of its origin. I understand it may be offtopic for FSF GDB but from some GDB crashes I am not sure if it can happen only due to the VLA variables. Thanks, Jan gdb/ 2010-06-01 Jan Kratochvil Tom Tromey * utils.c (nomem): Change internal_error to error. --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1265,15 +1265,9 @@ void nomem (long size) { if (size > 0) - { - internal_error (__FILE__, __LINE__, - _("virtual memory exhausted: can't allocate %ld bytes."), - size); - } + error (_("virtual memory exhausted: can't allocate %ld bytes."), size); else - { - internal_error (__FILE__, __LINE__, _("virtual memory exhausted.")); - } + error (_("virtual memory exhausted.")); } /* The xmalloc() (libiberty.h) family of memory management routines.