karl@mote.umb.edu ("Karl Berry.") (01/23/89)
This is on a Sun 3 running 3.4.
I changed the Makefile from the distribution to not
define PARSE_OUTPUT when cplus-parse.tab.c is compiled.
The program
#include <stream.h>
main() { cout << "hello\n"; }
produces no output. I compiled both libg++1.25.0
and 1.32.0. Although no problems occurred in the compilation,
test0, along with all the other tests I tried, core dumps
upon startup. Doing gdb on it reveals that the problem
is in the << operator, but I don't know why.
g++ 1.31.0 did not have these problems.
Karl.
Here is the gdb backtrace:
(this is the 1.32.0 libg++)
ra# gdb test0 core
Reading symbol data from /nfs/src/gnu/libg++-1.32.0/tests/test0...done.
Core file is from "test0".
Program terminated with signal 11, Segmentation fault.
(gdb) bt
#0 0x4b94 in fprintf ()
#1 0x2212 in op$alshift_expr_PSofile_PQI ($this=(struct ofile *) 0x20034, p=(char *) 0x2690 "Enter file to link: (test.bye or test.bye2 or test.shell)\n") (test0.h line 73)
#2 0x2748 in main ((anon)=1, argv=(char **) 0xefff940) (test.hello.cc line 106)
(gdb) mdt@YAHI.STANFORD.EDU (Michael Tiemann) (01/24/89)
Problems with immediate core dumps in operator<< are usually related to ld++ linking crt0.o rather than crt0+.o. Compile your file with -v, and see which startup file is being linked. If it's not crt0+.o, fix STARTFILE_SPEC in your tm.h file. Michael