public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: martin.berger@talk21.com
To: gcc-help@gcc.gnu.org
Cc: martin.berger@talk21.com
Subject: problem with iostream
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <20000324111140.IFSD24016.t21mta03-app.talk21.com@t21mtaV-lrs> (raw)
Message-ID: <20000401000000.v4MbAsnrq5jDHuCgsbX_ryRHvgbFgaLp4Ldb65vrD7I@z> (raw)

hello, i have just upgraded to the latest version of redhat linux
and suddenly my g++ compiled programs fall over. the problem seems to
be related to the iostream library. here is an example program that
fails (the details of how cout is used dont seem to matter. the fault
seems to occur every time cout is used).

#include <iostream>

int main( int, char* )
{
      cout << "" << endl;
}

(below you'll find the relevant compiler and gdb output). alas, i'm not too
familiar with the g++ system and the redhat distribution. i suspect
that the problem is some trivial omission in my setup. but i can't work out
what. can you please help?

thanks, martin

~/c++/NEW> g++ -v test.cpp       
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ test.cpp /tmp/cc5KSDQU.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i586-pc-linux-gnu/include
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/cc1plus /tmp/cc5KSDQU.ii -quiet -dumpbase test.cc -version -o /tmp/cc814umP.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i586-pc-linux-gnu) compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
 as -V -Qy -o /tmp/ccKIZ6NC.o /tmp/cc814umP.s
GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version 2.9.1.0.24
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/crtbegin.o -L/usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66 -L/usr/local/i586-pc-linux-gnu/lib -L/usr/local/lib /tmp/ccKIZ6NC.o -lstdc++ -lm -lgcc -lc -lgcc /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/crtend.o /usr/lib/crtn.o
~/c++/NEW> ./a.out 
Segmentation fault (core dumped)



gdb a.out core 
GNU gdb 4.18
Copyright 1998 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 "i386-redhat-linux"...
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0  0x4008b012 in __overflow (f=0x80539e0, ch=10) at genops.c:197
197     genops.c: No such file or directory.
(gdb) where
#0  0x4008b012 in __overflow (f=0x80539e0, ch=10) at genops.c:197
#1  0x40088191 in _IO_putc (c=10, fp=0x80539e0) at putc.c:33
#2  0x804c0eb in endl (outs=@0x8053ae0)
    at ../../../egcs-1.1.2/libio/streambuf.h:395
#3  0x804cbb0 in ostream::operator<< (this=0x8053ae0, 
    func=0x804c0d8 <endl(ostream &)>)
    at ../../../egcs-1.1.2/libio/iostream.h:106
#4  0x804a322 in main ()
#5  0x4004d1eb in __libc_start_main (main=0x804a300 <main>, argc=1, 
    argv=0xbffffc94, init=0x8049dc0 <_init>, fini=0x8052360 <_fini>, 
    rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffc8c)
    at ../sysdeps/generic/libc-start.c:90
(gdb) 




--------------------
talk21 your FREE portable and private address on the net at http://www.talk21.com

             reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-24  3:11 martin.berger [this message]
2000-03-25 11:03 ` Martin v. Loewis
2000-04-01  0:00   ` Martin v. Loewis
2000-04-01  0:00 ` martin.berger
2000-03-26 12:18 Martin Berger
2000-03-26 13:24 ` Martin v. Loewis
2000-04-01  0:00   ` Martin v. Loewis
2000-04-01  0:00 ` Martin Berger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000324111140.IFSD24016.t21mta03-app.talk21.com@t21mtaV-lrs \
    --to=martin.berger@talk21.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).