This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug Report: Illegal Instruction
- To: Alexandre Oliva <aoliva at cygnus dot com>
- Subject: Re: Bug Report: Illegal Instruction
- From: Bill <billl at unm dot edu>
- Date: Wed, 24 May 2000 14:19:33 -0600 (MDT)
- cc: gcc-bugs at gcc dot gnu dot org
> Program received signal SIGILL, Illegal instruction.
> 0x0 in ?? () from /nfs/user/b/billl/test/notwork/TABLE
When you get to this point, try `step' instead of `next'.
I did a step at that point and kept stepping until got the error.
Recall that this occurs when printing the heading of the third row.
So I re-ran the program and also stepped through the same line of code
(i.e., "out << temp;") but for the second row's heading ... for
comparison purposes.
Results are appended. Note that the "first" set of steps is for the
second row's heading while the "second" set of steps is for the third
row's heading (with error). The "second" set of steps attempted an
"ostream::flush" just before the error. The "first" set never
attempted the "ostream::flush". Wish I could say I knew why the
difference ... but this seems to hint at your suggestion of a buffer
overflow. Like it tried to flush in order to save itself but couldn't
find the flush code. Seems like it ought to be able to find flush
code. (?)
My comments to the gdb output start with "//****"
Bill
//**** first set of steps
//**** printing out second row, starting with the row heading (column headings
already printed out)
Breakpoint 1, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:222
222 out << temp; //**** temp is the row heading
(gdb) s
__ls__H3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0_R7ostreamRCt12basic_string3ZX01ZX11ZX21_R7ostream (o=@0x20000db4, s=@0x2ff22b88)
at ../../../../../libg++/libstdc++/std/bastring.h:211
../../../../../libg++/libstdc++/std/bastring.h:211: No such file or directory.
(gdb) s
../../../../../libg++/libstdc++/std/bastring.cc:45: No such file or directory.
(gdb) s
ostream::write (this=0x2ff22b38, s=0x2ff22c30 " ", n=-559038737)
at ../../../../../libg++/libio/iostream.h:52
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
iostream.cc:931: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
../../../../../libg++/libio/streambuf.h:213: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:53: No such file or directory.
(gdb) s
//**** this is where the heading of the third row would have given the error.
But this, the printing of the second row just continues.
iostream.cc:932: No such file or directory.
(gdb) s
iostream.cc:935: No such file or directory.
(gdb) s
stdiobuf::xsputn (this=0x20000874, s=0x200030e8 "one", n=3) at stdiostream.cc:134
stdiostream.cc:134: No such file or directory.
(gdb) s
stdiostream.cc:140: No such file or directory.
(gdb) s
0x1000aa20 stdiostream.cc:137: No such file or directory.
(gdb) s
ostream::write (this=0x20000db4, s=0x200030e8 "one", n=3) at iostream.cc:936
iostream.cc:936: No such file or directory.
(gdb) s
../../../../../libg++/libio/streambuf.h:182: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:55: No such file or directory.
(gdb) s
iostream.cc:940: No such file or directory.
(gdb) s
0x1002cc7c in __ls__H3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0_R7ostreamRCt12basic_string3ZX01ZX11ZX21_R7ostream (o=@0x20000db4, s=@0xf024b1a0)
at ../../../../../libg++/libstdc++/std/bastring.cc:45
../../../../../libg++/libstdc++/std/bastring.cc:45: No such file or directory.
(gdb) s
Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:223
223 while (diff > 0){
(gdb) s
224 out << " "; /**** code immediately associated with the
(gdb) c
Continuing.
Breakpoint 2, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:228
228 if (col != 0) // right justifies all else
(gdb) c
Continuing.
one 1 2 3
//**** second set of steps
//**** printing out third row, starting with the row heading
Breakpoint 1, Table::Print (this=0x2ff22c30, out=@0x20000db4) at Table.C:222
222 out << temp;
(gdb) s
__ls__H3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0_R7ostreamRCt12basic_string3ZX01ZX11ZX21_R7ostream (o=@0x20000db4, s=@0x2ff22b88)
at ../../../../../libg++/libstdc++/std/bastring.h:211
../../../../../libg++/libstdc++/std/bastring.h:211: No such file or directory.
(gdb) s
../../../../../libg++/libstdc++/std/bastring.cc:45: No such file or directory.
(gdb) s
ostream::write (this=0x2ff22b38, s=0x2ff22c30 " ", n=-559038737)
at ../../../../../libg++/libio/iostream.h:52
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
iostream.cc:931: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
../../../../../libg++/libio/streambuf.h:213: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:52: No such file or directory.
(gdb) s
../../../../../libg++/libio/iostream.h:53: No such file or directory.
(gdb) s
ostream::flush (this=0x2ff22b90) at iostream.cc:854
iostream.cc:854: No such file or directory.
(gdb) s
Program received signal SIGILL, Illegal instruction.
0x0 in ?? () from /nfs/user/b/billl/test/notwork/TABLE