public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-08 16:58 Jim Blandy
0 siblings, 0 replies; 8+ messages in thread
From: Jim Blandy @ 2008-02-08 16:58 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: "Jim Blandy" <jimb@red-bean.com>
To: "jacob navia" <jacob@jacob.remcomp.fr>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2412: gdb crashes with complex data
Date: Fri, 8 Feb 2008 08:51:46 -0800
On Feb 7, 2008 11:09 AM, jacob navia <jacob@jacob.remcomp.fr> wrote:
> I downloaded and installed the sources you recommended me
> and the bug disappears.
Glad to hear it!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 20:18 Greg Law
0 siblings, 0 replies; 8+ messages in thread
From: Greg Law @ 2008-02-07 20:18 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4158 bytes --]
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: Greg Law <glaw@undo-software.com>
To: jacob@jacob.remcomp.fr
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2412: gdb crashes with complex data
Date: Thu, 07 Feb 2008 20:12:10 +0000
This is a multi-part message in MIME format.
--------------010303040502090909070606
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
This sounds like it could be the same issue that I reported (and
supplied a patch for) a few days ago.
Jacob - could you try with the attached patch applied and see if it
solves your problem?
Cheers,
Greg
jacob@jacob.remcomp.fr wrote:
>> Number: 2412
>> Category: c++
>> Synopsis: gdb crashes with complex data
>> Confidential: no
>> Severity: critical
>> Priority: high
>> Responsible: unassigned
>> State: open
>> Class: sw-bug
>> Submitter-Id: net
>> Arrival-Date: Wed Feb 06 23:38:01 UTC 2008
>> Closed-Date:
>> Last-Modified:
>> Originator: Jacob Navia
>> Release: GNU gdb 6.7.1
>> Organization:
>> Environment:
> linux
>> Description:
> Every time I want to display a complex number in gdb
> it crashes.
>
> Crash in
> void
> print_floating (const gdb_byte *valaddr, struct type *type,
> struct ui_file *stream)
>
> How to reproduce
>
> 1) Define a long double _Complex number.
> For example: long double _Complex foo = 4.8;
> 3) In gdb type
> print foo
>
> crash, gdb dies.
>
> This is after I downloaded the latest version.
>
> Machine:
>
> i486 linux vanilla ubuntu distribution.
> root@ubuntu:/tmp/gdb-6.7.1/gdb# gcc -v
> Utilisation des specs internes.
> Target: i486-linux-gnu
> Configuré avec: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2 .0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
> Modèle de thread: posix
> version gcc 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
>
> root@ubuntu:/tmp/gdb-6.7.1/gdb# gdb -v
> GNU gdb 6.7.1
> Copyright (C) 2007 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
>> How-To-Repeat:
> 1) Define a long double _Complex number.
> For example: long double _Complex foo = 4.8;
> 2) In gdb type
> print foo
>
> crash, gdb dies.
>> Fix:
>
>> Release-Note:
>> Audit-Trail:
>> Unformatted:
--
Greg Law, Undo Software http://undo-software.com/
--------------010303040502090909070606
Content-Type: text/x-patch;
name="regcache_fix.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="regcache_fix.patch"
Index: gdb/regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.163
diff -u -r1.163 regcache.c
--- gdb/regcache.c 1 Jan 2008 22:53:12 -0000 1.163
+++ gdb/regcache.c 4 Feb 2008 22:24:32 -0000
@@ -472,6 +472,9 @@
regcache_xfree (current_regcache);
current_regcache = NULL;
+ /* Need to forget about any frames we have cached, too. */
+ reinit_frame_cache ();
+
/* Force cleanup of any alloca areas if using C alloca instead of
a builtin alloca. This particular call is used to clean up
areas allocated by low level target code which may build up
--------------010303040502090909070606--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 19:18 jacob navia
0 siblings, 0 replies; 8+ messages in thread
From: jacob navia @ 2008-02-07 19:18 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: jacob navia <jacob@jacob.remcomp.fr>
To: Jim Blandy <jimb@red-bean.com>, gdb-gnats@sources.redhat.com
Cc:
Subject: Re: c++/2412: gdb crashes with complex data
Date: Thu, 07 Feb 2008 20:09:47 +0100
Hi Jim
I downloaded and installed the sources you recommended me
and the bug disappears.
Thanks for your time.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 3:38 Daniel Jacobowitz
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2008-02-07 3:38 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@false.org>
To: Jim Blandy <jimb@red-bean.com>, gdb-gnats@sourceware.org
Cc:
Subject: Re: c++/2412: gdb crashes with complex data
Date: Wed, 6 Feb 2008 22:30:35 -0500
On Thu, Feb 07, 2008 at 02:38:01AM -0000, Jim Blandy wrote:
> The new test program you submitted seems to work for me as well.
It probably depends on the compiler in use.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 2:38 Jim Blandy
0 siblings, 0 replies; 8+ messages in thread
From: Jim Blandy @ 2008-02-07 2:38 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: "Jim Blandy" <jimb@red-bean.com>
To: "jacob navia" <jacob@jacob.remcomp.fr>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2412: gdb crashes with complex data
Date: Wed, 6 Feb 2008 18:34:45 -0800
If you leave the gdb-gnats@sources.redhat.com address in the CC line,
GDB's bug-tracking system will automatically include your notes in the
bug database entry, which is helpful for other people following along.
I wasn't able to find the test program you provided in your original
description --- only English descriptions of what to try.
The new test program you submitted seems to work for me as well. Have
you checked out the current GDB sources from CVS and built them?
There are instructions for doing so at
http://sourceware.org/gdb/current/.
On Feb 6, 2008 5:30 PM, jacob navia <jacob@jacob.remcomp.fr> wrote:
>
> Jim Blandy wrote:
> > This seems to be fixed in the current sources. Would you like to try
> > building from CVS and see if the problem still occurs?
> >
> > If it does, please provide a specific test program we can use.
> > There's no reason to provide hints when exact instructions are not
> > much more trouble.
> >
> > $ cat complex.c
> > cat: complex.c: No such file or directory
> > $ cd ~/play
> > $ cat complex.c
> > #include <stdio.h>
> >
> > long double _Complex foo = 4.8;
> >
> > int
> > main (int argc, char **argv)
> > {
> > puts ("Hello, world!");
> > return 0;
> > }
> > $ gcc -g complex.c -o complex
> > $ ~/gdb/pub/nat/gdb/gdb ~/play/complex
> > GNU gdb 6.7.50.20080111-cvs
> > Copyright (C) 2008 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> > and "show warranty" for details.
> > This GDB was configured as "i686-pc-linux-gnu"...
> > (gdb) start
> > Breakpoint 1 at 0x8048395: file complex.c, line 8.
> > Starting program: /home/jimb/play/complex
> > main () at complex.c:8
> > 8 puts ("Hello, world!");
> > (gdb) print foo
> > $1 = 4.7999999999999998223643160599749535 + 0 * I
> > (gdb)
> >
>
> Please, I sent you a program that crashes gdb in my bug description.
> You used a GLOBAL variable. Please use a local variable:
>
> int main(void)
> {
> long double _Complex s = 1;
> long double _Complex m = 1;
> }
>
> put a breakpoint after the first assignment and in gdb type
> print s
> This will crash gdb with a segmentation fault
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 1:28 Jim Blandy
0 siblings, 0 replies; 8+ messages in thread
From: Jim Blandy @ 2008-02-07 1:28 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: "Jim Blandy" <jimb@red-bean.com>
To: jacob@jacob.remcomp.fr
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2412: gdb crashes with complex data
Date: Wed, 6 Feb 2008 17:20:48 -0800
This seems to be fixed in the current sources. Would you like to try
building from CVS and see if the problem still occurs?
If it does, please provide a specific test program we can use.
There's no reason to provide hints when exact instructions are not
much more trouble.
$ cat complex.c
cat: complex.c: No such file or directory
$ cd ~/play
$ cat complex.c
#include <stdio.h>
long double _Complex foo = 4.8;
int
main (int argc, char **argv)
{
puts ("Hello, world!");
return 0;
}
$ gcc -g complex.c -o complex
$ ~/gdb/pub/nat/gdb/gdb ~/play/complex
GNU gdb 6.7.50.20080111-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) start
Breakpoint 1 at 0x8048395: file complex.c, line 8.
Starting program: /home/jimb/play/complex
main () at complex.c:8
8 puts ("Hello, world!");
(gdb) print foo
$1 = 4.7999999999999998223643160599749535 + 0 * I
(gdb)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: c++/2412: gdb crashes with complex data
@ 2008-02-07 1:21 jimb
0 siblings, 0 replies; 8+ messages in thread
From: jimb @ 2008-02-07 1:21 UTC (permalink / raw)
To: gdb-prs, jacob, nobody
Synopsis: gdb crashes with complex data
State-Changed-From-To: open->closed
State-Changed-By: jimb
State-Changed-When: Thu Feb 7 01:21:58 2008
State-Changed-Why:
Apparently fixed in CVS.
http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=2412
^ permalink raw reply [flat|nested] 8+ messages in thread
* c++/2412: gdb crashes with complex data
@ 2008-02-06 23:38 jacob
0 siblings, 0 replies; 8+ messages in thread
From: jacob @ 2008-02-06 23:38 UTC (permalink / raw)
To: gdb-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]
>Number: 2412
>Category: c++
>Synopsis: gdb crashes with complex data
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Feb 06 23:38:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Jacob Navia
>Release: GNU gdb 6.7.1
>Organization:
>Environment:
linux
>Description:
Every time I want to display a complex number in gdb
it crashes.
Crash in
void
print_floating (const gdb_byte *valaddr, struct type *type,
struct ui_file *stream)
How to reproduce
1) Define a long double _Complex number.
For example: long double _Complex foo = 4.8;
3) In gdb type
print foo
crash, gdb dies.
This is after I downloaded the latest version.
Machine:
i486 linux vanilla ubuntu distribution.
root@ubuntu:/tmp/gdb-6.7.1/gdb# gcc -v
Utilisation des specs internes.
Target: i486-linux-gnu
Configuré avec: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Modèle de thread: posix
version gcc 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
root@ubuntu:/tmp/gdb-6.7.1/gdb# gdb -v
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
>How-To-Repeat:
1) Define a long double _Complex number.
For example: long double _Complex foo = 4.8;
2) In gdb type
print foo
crash, gdb dies.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-02-08 16:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 16:58 c++/2412: gdb crashes with complex data Jim Blandy
-- strict thread matches above, loose matches on Subject: below --
2008-02-07 20:18 Greg Law
2008-02-07 19:18 jacob navia
2008-02-07 3:38 Daniel Jacobowitz
2008-02-07 2:38 Jim Blandy
2008-02-07 1:28 Jim Blandy
2008-02-07 1:21 jimb
2008-02-06 23:38 jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).