g++ istream core dump

Nick Thurn nick.thurn@db.com
Sun Jun 2 17:15:00 GMT 2002


Folks,

The following code is core dumping:

#include <iostream>

int main() {
    std::istream::sentry check(std::cin,false);
    return 0;
}

This means all extractors also core dump.

The dump appears to occur in ctype_inlines.h : 40
however all that is there is:

  bool ctype<char>::is(mask __m, char __c) const
  { return _M_table[static_cast<unsigned char>(__c)] & __m; }

This leads me to believe that _M_table has not been
initialised. A function in ctype_noninline.h tends
to confirm this is possible.

  const ctype_base::mask*
  ctype<char>::classic_table() throw()
  { return 0; }

I notice that in the config/solaris2.7 code the same
method returns "__ctype_mask" and that the sys/ctype.h
file in /usr/local/include includes this symbol.

Many of the iostream methods are somehow linked into
libstdc++.4.0.0.so and do not expand in .o files. These
include the std::istream::sentry constructor above.
Which makes messing about with the headers without
recompiling the library a problem (I am linked
via dialup at present and can't recompile or even
loadf the source in a reasonable time).

I am wondering if there is some config option that is
either incorrect for solaris 2.6 or missing from
the make of gcc-3.1. Or what else I may have stuffed
up!!

Output from a compile and run is as follows:

kilmer: ~>g++ -v test.cpp -o test
Reading specs from /apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/apps/race/gcc
--with-gnu-as --with-as=/apps/race/gcc/bin/as --with-gnu-ld
--with-ld=/apps/race/gcc/bin/ld --enable-languages=c,c++
Thread model: posix
gcc version 3.1
 /apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/cc1plus -v
-D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -Dsparc -Dsun
-Dunix -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__
-D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME
-D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__
-D__STDC_HOSTED__=1 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1
-D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__
-Acpu=sparc -Amachine=sparc test.cpp -D__GNUG__=3 -D__DEPRECATED
-D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase test.cpp
-version -o /var/tmp//cckfFpjC.s
GNU CPP version 3.1 (cpplib) (sparc ELF)
GNU C++ version 3.1 (sparc-sun-solaris2.6)
        compiled by GNU C version 3.1.
ignoring nonexistent directory
"/apps/race/gcc/sparc-sun-solaris2.6/include"
#include "..." search starts here:
#include <...> search starts here:
 /apps/race/gcc/include/g++-v3
 /apps/race/gcc/include/g++-v3/sparc-sun-solaris2.6
 /apps/race/gcc/include/g++-v3/backward
 /usr/local/include
 /apps/race/gcc/include
 /apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/include
 /usr/include
End of search list.
 /apps/race/gcc/bin/as -V -Qy -s -o /var/tmp//cctHbyr2.o
/var/tmp//cckfFpjC.s
GNU assembler version 2.12 (sparc-sun-solaris2.6) using BFD version
2.12
 /apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/collect2 -V -Y
P,/usr/ccs/lib:/usr/lib -Qy -o test
/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/crt1.o
/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/crti.o
/usr/ccs/lib/values-Xa.o
/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/crtbegin.o
-L/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1
-L/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/../../../../sparc-sun-solaris2.6/lib
-L/usr/ccs/bin -L/usr/ccs/lib
-L/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/../../..
/var/tmp//cctHbyr2.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -lc
/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/crtend.o
/apps/race/gcc/lib/gcc-lib/sparc-sun-solaris2.6/3.1/crtn.o
GNU ld version 2.12
  Supported emulations:
   elf32_sparc
kilmer: ~>test
12
Segmentation fault (core dumped)
kilmer: ~>

If anyone could shed any light I'd be most grateful

Thanks in advance.

cheers
Nick

(Embedded image moved to file: pic14460.jpg)


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic14460.jpg
Type: image/jpeg
Size: 631 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20020602/fe3022e5/attachment.jpg>


More information about the Libstdc++ mailing list