stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: strstream infinite loop
Date Sat, 18 Mar 2006 20:55:53 GMT
ryan owen wrote:
> I'm new to stdcxx and the mailing list, but I'm hoping someone can
> help with the problem I'm having.  My environment is HP-UX 11.00,
> patched such that libc contains wide character support (although its
> missing a few functions). I'm using stdcxx 4.1.3 built with GCC 3.2.1.
>  The config.h used to build it is attached

It looks like either forgot to attach it or it got stripped by ezmlm.

> The problem is that whenever a strstream is used, the program goes
> into an infinite loop.  I'm not sure exactly what condition causes the
> problem.  In my code, it happens if I direct an endl into the
> strstream object (strstreamobject << endl) or when the object goes out
> of scope.

This sounds similar to the problem described here:

> If I run the strstream example include in the stdcxx source
> tarball, it gets as far as outputting "Full text, 104 characters: "
> followed by "This is the story of a man." in various languages.  The
> example is supposed to then loop through the stream one line at a
> time, but it hangs instead.
> I've looked at the preprocessor output to make sure that the strstream
> symbol is being resolved to the one defined in stdcxx at compile time,
> and not from some gcc header.

Good thinking! :)

> The verbose linker output shows that it is also resolving to stdcxx at
> link time.

Yes, linking with gcc (as opposed to g++) prevents linking with
libstdc++, the GNU C++ Standard Library.

> Various symbols that stdcxx references, such as the new and delete
> operators, are being resolved to GNU's libsupc++.  I'm not sure if
> there are any incompatibilities between stdcxx and GNU's libsupc++
> that may be causing the problem.

No, that's by design. The language runtime library is libsupc++,
the whole C++ Standard Library is libstdc++ when linking with

> Does anyone have any suggestions on how to troubleshoot this?  Any
> help is greatly apreciated.

It would be good to know the build type you did (i.e., what value
you set the BUILDTYPE make variable when you configured the library),
and how your gcc is configured (gcc -v).

I tested with gcc 3.4.2 on HP-UX 11.11 (
and after fixing a couple of minor issues (STDCXX-164, STDCXX-165,
and STDCXX-166: the strstream
example built and ran fine in both an 8d and 12d build type
(i.e, optimized, shared library, single-thread and thread-safe,
respectively). Attached is my config.h in case you find it useful.

I will need to build gcc 3.2.1 on one of our servers to see if I
can reproduce it and figure out what's going on. While I'm doing
it you might want to give a later version of gcc a try to see if
it maybe resolves the problem.


View raw message