C++ std::stringstream seemingly causes thread to hang or die under SunOS
- by stretch
I have an application developed under Linux with GCC 4.2 which makes quite heacy use of stringstreams to wrap and unwrap data being sent over the wire. (Because the Grid API I'm using demands it). Under Linux everything is fine but when I deploy to SunOS (v5.10 running SPARC) and compile with GCC 3.4.6 the app hangs when it reaches the point at which stringstreams are used.
In more detail: The main thread accepts requests from clients and starts a new pthread to handle each request. The child thread uses stringstreams to pack data. When the child thread gets to that point it seems to hang for a second and then die. The main thread is unaffected.
Are there any known issues with stringstream and GCC 3.4.6 or SunOS or SPARCs? I didn't find anything yet...
Can anyone suggest a better way to pack and unpack large amounts of data a strings or byte streams?
Apologies for not posting code but this to me seems more involved than a simple syntax error. All the same, the thread crashes:
std::stringstream mystringstream; //not here
mystringstream << "some data: "; //but here
That is, I can declare the stringstream but when I try to use it something goes wrong.