This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc patch] nomem: internal_error -> error
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: jan dot kratochvil at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 1 Jun 2010 19:55:40 +0200 (CEST)
- Subject: Re: [rfc patch] nomem: internal_error -> error
- References: <20100601164808.GA22487@host0.dyn.jankratochvil.net>
> Date: Tue, 1 Jun 2010 18:48:08 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
> 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.
>
> I find simple error as a perfectly reasonable there.
I disagree; this internal-error really is a bug in GDB. We should
never try to allocate that much memory.