bug-gdb
[Top][All Lists]
Advanced

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

Strongly suspected gdb bug.


From: Casey Callaghan
Subject: Strongly suspected gdb bug.
Date: Fri, 8 Apr 2005 14:58:28 +0200
User-agent: KMail/1.6.2

Short version: I got bad output. My code at the time was fairly complex 
(alright, very complex), but I managed to rig up a far simpler test case - it 
refuses to restart the test program and gives an apparantly arbitrary 
backtrace of over a thousand levels. 

My test case is attached, and below is a Konsole dump showing how I reproduced 
the bug with the test case.

Konsole dump (mildly edited because it gives me a REALLY long backtrace, and 
to tell you whare I had to press ctrl-C.)

address@hidden:~/Multicaster/Sender> g++ gdb_bug2.cpp gdb_bug.cpp -Wall -ggdb
address@hidden:~/Multicaster/Sender> gdb a.out
GNU gdb 6.1
Copyright 2004 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-suse-linux"...Using host libthread_db library 
"/lib/libthread_db.so.1".

(gdb) break main
Breakpoint 1 at 0x8048488: file gdb_bug.cpp, line 6.
(gdb) run
Starting program: /home/casey/Multicaster/Sender/a.out

Breakpoint 1, main (argc=1, argv=0xbffff264) at gdb_bug.cpp:6
6           TestMe.TestBug();
(gdb) s
Bug::TestBug (this=0xbffff217) at gdb_bug2.cpp:7
7           for (Count = 0;Count < 20; Count++)
(gdb) p Test
$1 = {HidingAway = {1074658380, 1073909760, -1073745500, 1074901400, 
1073907584, -1073745468, 1074171166, 1074171184, 0,
    -1073745468, 1074154638, 1074661732, 1074658412, -1073745452, 1074547799, 
1073833696, 1073905664, 1073833696, 1,
    1073834296}}
(gdb) p &Test
$2 = (Bug::Hidden *) 0xbffff190
(gdb) p *(Hidden *)0xbffff190
$3 = {HidingAway = {1074658380, 1073909760, -1073745500, 1074901400, 
1073907584, -1073745468, 1074171166, 1074171184, 0,
    -1073745468, 1074154638, 1074661732, 1074658412, -1073745452, 1074547799, 
1073833696, 1073905664, 1073833696, 1,
    1073834296}}
(gdb) watch *(Hidden *)0xbffff190
Watchpoint 2: *(Bug::Hidden *) 3221221776
(gdb) n
8               Test.HidingAway[Count] = Count;
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x08048488 in main at gdb_bug.cpp:6
        breakpoint already hit 1 time
2   watchpoint     keep y              *(Bug::Hidden *) 3221221776
(gdb) run
Starting program: /home/casey/Multicaster/Sender/a.out

(...seems to just stop here. I had to press ctrl-C to get any further 
response...)

Program received signal SIGINT, Interrupt.
0x40012a9a in ?? ()
(gdb) bt
#0  0x40012a9a in ?? ()
#1  0x40007f4f in ?? ()
#2  0x4005b5cf in ?? ()
#3  0x4005b5cf in ?? ()
#4  0x00000001 in ?? ()
#5  0x00000020 in ?? ()
#6  0x00000000 in ?? ()
#7  0x00000000 in ?? ()
#8  0x4005b68a in ?? ()
#9  0x40039e48 in ?? ()
#10 0x4002d388 in ?? ()
#11 0x40028000 in ?? ()
#12 0x00000006 in ?? ()
#13 0x40028a9c in ?? ()
#14 0x40035a48 in ?? ()
#15 0x0c7da9c5 in ?? ()
#16 0x4004063f in ?? ()
#17 0x400166e0 in ?? ()
#18 0x400281a0 in ?? ()
#19 0x00000000 in ?? ()
#20 0xbfffeb50 in ?? ()
#21 0x400080cc in ?? ()
#22 0xbfffeb0c in ?? ()
#23 0x40016a88 in ?? ()
#24 0x00000001 in ?? ()
#25 0x40028b18 in ?? ()
#26 0x00000000 in ?? ()
#27 0x00000000 in ?? ()
#28 0x00000000 in ?? ()
#29 0x400005a8 in ?? ()
#30 0x401211ba in ?? ()
#31 0x40028768 in ?? ()
#32 0x4000cf56 in ?? ()
#33 0xbfffeb0c in ?? ()
#34 0x00000000 in ?? ()
#35 0x00000000 in ?? ()
#36 0x00000000 in ?? ()
---Type <return> to continue, or q <return> to quit---
#37 0x00000000 in ?? ()
#38 0x00000000 in ?? ()
#39 0x00000000 in ?? ()
#40 0x0c7da9c5 in ?? ()
#41 0xbfffec0c in ?? ()
#42 0x40028000 in ?? ()
#43 0x4004063f in ?? ()
#44 0x00000000 in ?? ()
#45 0x00000000 in ?? ()
#46 0x00000000 in ?? ()
#47 0x00000000 in ?? ()
#48 0x00000000 in ?? ()
#49 0x00000000 in ?? ()
#50 0x00000000 in ?? ()
#51 0x00000000 in ?? ()
#52 0x40010f3a in ?? ()
#53 0x00000000 in ?? ()
#54 0x00000000 in ?? ()
#55 0x400166e0 in ?? ()
#56 0x0804828c in ?? ()
#57 0x00000001 in ?? ()
#58 0x40028780 in ?? ()
#59 0x400166e0 in ?? ()
#60 0x00000006 in ?? ()
#61 0x00000010 in ?? ()
#62 0x400166e0 in ?? ()
#63 0x40028b18 in ?? ()
#64 0x00000000 in ?? ()
#65 0xbfffec64 in ?? ()
#66 0x4000a996 in ?? ()
#67 0x400281a0 in ?? ()
#68 0x40028b18 in ?? ()
#69 0x00000000 in ?? ()
#70 0x00000000 in ?? ()
#71 0x00000000 in ?? ()
#72 0x00086c01 in ?? ()
#73 0x00000006 in ?? ()
---Type <return> to continue, or q <return> to quit---
#74 0x40016058 in ?? ()
#75 0x00000000 in ?? ()
#76 0x400166e0 in ?? ()
#77 0x0804822d in ?? ()
#78 0x401225a4 in ?? ()
#79 0x40016058 in ?? ()
#80 0x401225a4 in ?? ()
#81 0x0000000c in ?? ()
#82 0x00000005 in ?? ()
#83 0x40016698 in ?? ()
#84 0x400e9028 in ?? ()
#85 0x400e70cc in ?? ()
#86 0x400e6000 in ?? ()
#87 0x00000000 in ?? ()
#88 0x00000000 in ?? ()
#89 0x00000000 in ?? ()
#90 0x40028280 in ?? ()
#91 0x00000002 in ?? ()
#92 0x400101c8 in ?? ()
#93 0x40016bd0 in ?? ()
#94 0x40016414 in ?? ()
#95 0x40028000 in ?? ()
#96 0x40035a48 in ?? ()
#97 0x00000001 in ?? ()
#98 0x400cc6e0 in ?? ()
#99 0x4005b68a in ?? ()
#100 0x4002d388 in ?? ()
#101 0x40029000 in ?? ()
#102 0x400617f4 in ?? ()
#103 0x4005f22c in ?? ()
#104 0x00004620 in ?? ()
#105 0x40028000 in ?? ()
#106 0x00000000 in ?? ()
#107 0x40016058 in ?? ()
#108 0x00000000 in ?? ()
#109 0xbfffec20 in ?? ()
#110 0x4000e622 in ?? ()
---Type <return> to continue, or q <return> to quit---

(...several screens later...)

#1370 0x4f4c4f43 in ?? ()
#1371 0x52455452 in ?? ()
#1372 0x4a003d4d in ?? ()
#1373 0x5f415641 in ?? ()
#1374 0x544f4f52 in ?? ()
#1375 0x73752f3d in ?? ()
#1376 0x696c2f72 in ?? ()
#1377 0x616a2f62 in ?? ()
#1378 0x2f006176 in ?? ()
#1379 0x656d6f68 in ?? ()
#1380 0x7361632f in ?? ()
#1381 0x4d2f7965 in ?? ()
#1382 0x69746c75 in ?? ()
#1383 0x74736163 in ?? ()
#1384 0x532f7265 in ?? ()
#1385 0x65646e65 in ?? ()
#1386 0x2e612f72 in ?? ()
#1387 0x0074756f in ?? ()
#1388 0x00000000 in ?? ()
Cannot access memory at address 0xc0000000
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)



Background info:

GDB version:GNU gdb 6.1 (This GDB was configured as "i586-suse-linux".)

OS: Suse Linux

Compiler used to compile GDB: No idea. Whatever Suse uses in their packages.

Compiler used to compile gdb_bug.cpp: gcc.

Another Konsole dump:
address@hidden:~/Multicaster/Sender> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada 
--disable-checking --libdir=/usr/lib --enable-libgcj 
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib 
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)

A complete input script, all necessary source files, to reproduce the bug is 
included (either as attachments or in the first konsole dump).

What I believe is incorrect: The 1388-level backtrace. (Later tries showed 
that the actual length of the backtrace is slightly variable - I got 1371 
lines the next time I tried this.)

I hope that I have included sufficient information. Please let me know if I 
have left out anything important.

Casey

Attachment: gdb_bug2.cpp
Description: Text Data

Attachment: gdb_bug.cpp
Description: Text Data

Attachment: gdb_bug2.h
Description: Text Data


reply via email to

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