bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB crashes when evaluating an expression


From: Michael Elizabeth Chastain
Subject: Re: GDB crashes when evaluating an expression
Date: Wed, 16 Jun 2004 01:30:32 -0400 (EDT)

Hi Xavier,

I'm working through the backlog of bug reports form address@hidden
and I reached this report from you, dated 2004-02-17.

I have a native i686-pc-linux-gnu system, red hat 8.0.
When I run gdb 5.3 on your test case, I get:

  Breakpoint 1, main () at foobar.c:6
  6         for (i = 0; ; i++)
  $1 = "foobar"
  Segmentation fault (core dumped)

When I run gdb 6.0 and gdb 6.1, they work fine.

Can you please try gdb 6.1 and let me know if it works for you?
If it doesn't work, then I need to know more about the system that
you're running on: specifically the distro name and version number
and the results of running "ldd foobar" on your foobar executable.

The issue in gdb is: when gdb executes "print "foobar"", gdb has to
allocate space in the inferior program for the string "foobar".
gdb does this by calling "malloc" in the inferior program behind the
scenes.  That's why your test program might expose a bug in gdb.

Michael C
GDB QA Guy

===

Date: Tue, 17 Feb 2004 08:22:20 -0500
From: address@hidden (Xavier de Gaye)
To: address@hidden
Subject: GDB crashes when evaluating an expression
List-Id: Bug reports for GDB, the GNU debugger  <bug-gdb.gnu.org>


GDB crashes when evaluating an expression. See test case below.

====================================================================
/* The foobar program */
main()
{
    int i;

    for (i = 0; ; i++)
    {
    printf("value %d\n", i);
    }
}
========================= GDB INPUT ================================
file foobar
break main
commands 1
print "foobar"
end
run
========================= GDB OUTPUT ===============================
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu".
(gdb) Reading symbols from foobar...done.
(gdb) Breakpoint 1 at 0x8048466: file foobar.c, line 6.
(gdb) >>(gdb) Starting program: /home/xavier/tmp/foobar 

Breakpoint 1, main () at foobar.c:6
6       for (i = 0; ; i++)
$1 = "foobar"
warning: Invalid control type in command structure.
Segmentation fault
====================================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]