* Fri Aug 6 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1.90.20100806-8.fc14

- Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
This commit is contained in:
Jan Kratochvil 2010-08-06 18:57:00 +02:00
parent fc20e6331a
commit dbdd4476b8
2 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,69 @@
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
Subject: [rfc patch] nomem: internal_error -> error
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 <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* 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.

View File

@ -36,7 +36,7 @@ Version: 7.1.90.20100806
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 7%{?_with_upstream:.upstream}%{dist}
Release: 8%{?_with_upstream:.upstream}%{dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
Group: Development/Debuggers
@ -423,6 +423,9 @@ Patch491: gdb-gdb-add-index-script.patch
# Fix gcore from very small terminal windows (BZ 555076).
Patch493: gdb-bz555076-gcore-small-height.patch
# Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
Patch496: gdb-bz568248-oom-is-error.patch
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
BuildRequires: readline-devel%{?_isa}
@ -675,6 +678,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch489 -p1
%patch491 -p1
%patch493 -p1
%patch496 -p1
%patch393 -p1
%patch335 -p1
@ -1003,6 +1007,9 @@ fi
%endif
%changelog
* Fri Aug 6 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1.90.20100806-8.fc14
- Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
* Fri Aug 6 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1.90.20100806-7.fc14
- Fix gcore from very small terminal windows (BZ 555076).
- Fix false `filesystem' debuginfo rpm request (BZ 599598).