This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ostream::rdbuf(streambuf) does not work on ppc-aix4.3




I am not sure if I compiled gcc-3.0 correctly since the following code
crashes on my system:

------------------- rdbuf.cc -------
#include <iostream>
using namespace std;
int main()
{
   ostream out(cout.rdbuf());
   cout << "cout printing works, and can print numbers like " << 10 <<
endl;
   out << "out printing fails, it crashes printing numbers like " << 10 <<
endl;
   return 0;
}

---------------- end rdbuf.cc -----
When I run resulting code this is what I get:
$ ./a.out
cout printing works, and can print numbers like 10
out printing fails, it crashes printing numbers like Abort (core dumped)


Running this under gdb-5.0 gives (could not compile gdb from CVS,
compilation fails):

------------ start "bt" in gdb -----------
(gdb) bt
#0  0xd05b8128 in raise ()
#1  0xd05b1864 in abort ()
#2  0xd40187ec in _ZN10__cxxabiv111__terminateEPFvvE (handler=0)
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#3  0xd4018874 in _ZSt9terminatev ()
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#4  0xd4019c6c in __cxa_throw (obj=0x0, tinfo=0xffffffff, dest=0xffffffff)
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_throw.cc:77
#5  0xd4014c84 in _ZSt16__throw_bad_castv ()
    at ../../../../gcc/libstdc++-v3/src/functexcept.cc:50
#6  0x10002a60 in
_ZNSt9basic_iosIcSt11char_traitsIcEE14_M_check_facetEPKNSt6locale5facetE
(this=0xdeadbeef, __f=0xffffffff)
    at /afs/haifa/proj7/gec2/gnu/include/g++-v3/bits/basic_ios.h:202
#7  0x10001c3c in _ZNSolsEl (this=0x2ff22360, __n=10)
    at /afs/haifa/proj7/gec2/gnu/include/g++-v3/bits/ostream.tcc:148
#8  0x10000a70 in _ZNSolsEi (this=0x2ff22360, __n=10)
    at /afs/haifa/proj7/gec2/gnu/include/g++-v3/bits/std_ostream.h:120
------------------ end "bt" ---------------



This works fine on Linux (tried my home machine with gcc-3.0, glibc2.1 and
kernel 2.4.x). This also works with gcc-2.95.2 and xlC-5.0 on my system.


$ as --version
GNU assembler 2.11
[copyright message removed]
This assembler was configured for a target of `powerpc-ibm-aix4.3.3.0'.

Compilation information:
$ g++ -v -g --save-temps rdbuf.cc
Reading specs from
/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/specs
Configured with: ../gcc/configure --prefix=/afs/haifa/proj7/gec2/gnu
--enable-languages=c++ --disable-multilib
Thread model: single
gcc version 3.0
 /afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/cpp0
-lang-c++ -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS
-D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=0
-D__GNUC_PATCHLEVEL__=0 -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43
-D_LONG_LONG -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43
-D_LONG_LONG -Asystem=unix -Asystem=aix -D__CHAR_UNSIGNED__ -D__NO_INLINE__
-D__STDC_HOSTED__=1 -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED=1
-D_LARGE_FILE_API -D_ALL_SOURCE -D_ARCH_COM rdbuf.cc rdbuf.ii
GNU CPP version 3.0 (cpplib)
#include "..." search starts here:
#include <...> search starts here:
 /afs/haifa/proj7/gec2/gnu/include/g++-v3
 /afs/haifa/proj7/gec2/gnu/include/g++-v3/powerpc-ibm-aix4.3.3.0
 /afs/haifa/proj7/gec2/gnu/include/g++-v3/backward
 /usr/local/include
 /afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/include
 /afs/haifa/proj7/gec2/gnu/powerpc-ibm-aix4.3.3.0/include
 /usr/include
End of search list.
 /afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/cc1plus
-fpreprocessed rdbuf.ii -quiet -dumpbase rdbuf.cc -g -version -o rdbuf.s
GNU CPP version 3.0 (cpplib)
GNU C++ version 3.0 (powerpc-ibm-aix4.3.3.0)
        compiled by GNU C version 3.0.

/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/../../../../powerpc-ibm-aix4.3.3.0/bin/as

--traditional-format -u -mcom -o rdbuf.o rdbuf.s
rdbuf.s: Assembler messages:
rdbuf.s:9391: Warning: Line numbers must be positive integers

rdbuf.s:9497: Warning: Line numbers must be positive integers

 /afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/collect2
-bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect
-bexport:/usr/lib/libg.exp /lib/crt0.o
-L/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0
-L/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/../../..
rdbuf.o -lstdc++ -lm -lgcc_s
/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/libgcc.a
-lg -lc -lgcc_s
/afs/haifa/proj7/gec2/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.0/libgcc.a
(See attached file: rdbuf.ii.bz2)

rdbuf.ii.bz2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]