|
|
190f2a |
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
|
190f2a |
From: Fedora GDB patches <invalid@email.com>
|
|
|
190f2a |
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
|
190f2a |
Subject: gdb-bz568248-oom-is-error.patch
|
|
|
190f2a |
|
|
|
190f2a |
;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248).
|
|
|
190f2a |
;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted.
|
|
|
190f2a |
|
|
|
190f2a |
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
|
|
|
190f2a |
|
|
|
190f2a |
Hi,
|
|
|
190f2a |
|
|
|
190f2a |
unfortunately I see this problem reproducible only with the
|
|
|
190f2a |
archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]).
|
|
|
190f2a |
OTOH this branch I hopefully submit in some form for FSF GDB later.
|
|
|
190f2a |
|
|
|
190f2a |
In this case (a general problem but tested for example on Fedora 13 i686):
|
|
|
190f2a |
|
|
|
190f2a |
int
|
|
|
190f2a |
main (int argc, char **argv)
|
|
|
190f2a |
{
|
|
|
190f2a |
char a[argc];
|
|
|
190f2a |
return a[0];
|
|
|
190f2a |
}
|
|
|
190f2a |
|
|
|
190f2a |
(gdb) start
|
|
|
190f2a |
(gdb) print a
|
|
|
190f2a |
../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes.
|
|
|
190f2a |
|
|
|
190f2a |
It is apparently because boundary for the variable `a' is not initialized
|
|
|
190f2a |
there. Users notice it due to Eclipse-CDT trying to automatically display all
|
|
|
190f2a |
the local variables on each step.
|
|
|
190f2a |
|
|
|
190f2a |
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
|
|
|
190f2a |
But is anone aware of the reasons to use internal_error there?
|
|
|
190f2a |
I find simple error as a perfectly reasonable there.
|
|
|
190f2a |
(history only tracks it since the initial import)
|
|
|
190f2a |
|
|
|
190f2a |
IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
|
|
|
190f2a |
|
|
|
190f2a |
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
|
|
|
190f2a |
sure if it can happen only due to the VLA variables.
|
|
|
190f2a |
|
|
|
190f2a |
Thanks,
|
|
|
190f2a |
Jan
|
|
|
190f2a |
|
|
|
190f2a |
gdb/
|
|
|
190f2a |
2010-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
190f2a |
Tom Tromey <tromey@redhat.com>
|
|
|
190f2a |
|
|
|
190f2a |
* utils.c (nomem): Change internal_error to error.
|
|
|
190f2a |
|
|
|
190f2a |
diff --git a/gdb/utils.c b/gdb/utils.c
|
|
|
190f2a |
--- a/gdb/utils.c
|
|
|
190f2a |
+++ b/gdb/utils.c
|
|
|
190f2a |
@@ -746,13 +746,11 @@ malloc_failure (long size)
|
|
|
190f2a |
{
|
|
|
190f2a |
if (size > 0)
|
|
|
190f2a |
{
|
|
|
190f2a |
- internal_error (__FILE__, __LINE__,
|
|
|
190f2a |
- _("virtual memory exhausted: can't allocate %ld bytes."),
|
|
|
190f2a |
- size);
|
|
|
190f2a |
+ error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
|
|
|
190f2a |
}
|
|
|
190f2a |
else
|
|
|
190f2a |
{
|
|
|
190f2a |
- internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
|
|
|
190f2a |
+ error (_("virtual memory exhausted."));
|
|
|
190f2a |
}
|
|
|
190f2a |
}
|
|
|
190f2a |
|