[gdb/f14/master] * Fri Aug 6 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1.90.20100806-8.fc14 - Out of memor

Jan Kratochvil jkratoch at fedoraproject.org
Fri Aug 6 16:57:23 UTC 2010


commit dbdd4476b8812fceb463b44a48778e852122ad17
Author: Jan Kratochvil <jan.kratochvil at redhat.com>
Date:   Fri Aug 6 18:57:00 2010 +0200

    * Fri Aug  6 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1.90.20100806-8.fc14
    - Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).

 gdb-bz568248-oom-is-error.patch |   69 +++++++++++++++++++++++++++++++++++++++
 gdb.spec                        |    9 ++++-
 2 files changed, 77 insertions(+), 1 deletions(-)
---
diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch
new file mode 100644
index 0000000..2aaf522
--- /dev/null
+++ b/gdb-bz568248-oom-is-error.patch
@@ -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 at redhat.com>
+	    Tom Tromey  <tromey at 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.
+
diff --git a/gdb.spec b/gdb.spec
index fa593a6..4d1ab6b 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -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 at 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 at 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).


More information about the scm-commits mailing list