Segmentation Fault(coredump) with g++ on SunOS 5.6

Herve Dutter hdutter@nospam.com
Tue Jan 4 07:22:00 GMT 2000


The problem comes from an incompatibility between the iostreams
libraries. The SunWspro compiler used on SunOS 5.6 has a new - so called
strandard - implementation of the iostreams in a static library named
libCstd.a. The problem is that this implementation of the iostreams is
totally incompatible with the good old libiostreams.a used by everyone
else, including the g++ compiler.

If you compile a cout << "hello" code with g++ this will work until you
link the executable with a shared object library that was generated with
SunWspro and uses the new "Cstd" iostreams. In that case, your
executable will coredump even before reaching your main entry point.

If you can identify the shared object that causes the problem, you may
be able to get it re-generated either with g++ or with the
"-libraries=iostreams,no%Cstd" option for the SunWspro compiler.

Other possible solutions are:
- exclusive use of SunWspro on solaris,
- triple memory size and link everything static,
- throw Solaris to the bin and go Linux.

I still have to make my own choice as I have the same problem and the
shared object is a third party...

jimjackson@sungardebs.com wrote:
> 
> Simple cout << "hello" type program fails with Segmentation Fault
> (coredump). compiling with -static causes program to work properly.
> Any ideas anyone?
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.


More information about the Gcc-help mailing list