Skip to content

Commit ddd5893

Browse files
ivanivanov884jeffmahoney
authored andcommitted
gdb-bz568248-oom-is-error.patch
;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). ;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html 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.
1 parent 29164e2 commit ddd5893

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

gdb/utils.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,11 @@ malloc_failure (long size)
692692
{
693693
if (size > 0)
694694
{
695-
internal_error (__FILE__, __LINE__,
696-
_("virtual memory exhausted: can't allocate %ld bytes."),
697-
size);
695+
error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
698696
}
699697
else
700698
{
701-
internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
699+
error (_("virtual memory exhausted."));
702700
}
703701
}
704702

0 commit comments

Comments
 (0)