gcc - C++ std::stringstream seemingly causes thread to hang or die under SunOS -
i have application developed under linux gcc 4.2 makes quite heavy use of stringstreams wrap , unwrap data being sent on wire. (because grid api i'm using demands it). under linux fine when deploy sunos (v5.10 running sparc) , compile gcc 3.4.6 app hangs when reaches point @ stringstreams used.
****new information added 9/7/2010**** still didn't solve after lot of tinkering around found clue. in fact think found problem i'm @ loss how fix it! see linker output below:
ld: warning: symbol `typeinfo std::basic_iostream<char, std::char_traits<char> >' has differing sizes: (file /home/roony/dssdk/cppdriver/lib/libdsdrivergcc3.so value=0x28; file /usr/sfw/lib/libstdc++.so value=0x20); /home/roony/dssdk/cppdriver/lib/libdsdrivergcc3.so definition taken
so warning says there mismatch in definition of iostream etc between 2 libraries how fix, or override 1 or other.. ****end new information****
in more detail: main thread accepts requests clients , starts new pthread handle each request. child thread uses stringstreams pack data. when child thread gets point seems hang second , die. main thread unaffected.
are there known issues stringstream , gcc 3.4.6 or sunos or sparcs? didn't find yet...
can suggest better way pack , unpack large amounts of data strings or byte streams?
apologies not posting code me seems more involved simple syntax error. same, thread crashes:
std::stringstream mystringstream; //not here mystringstream << "some data: "; //but here
that is, can declare stringstream when try use goes wrong.
probably "some data" want put stream invalid (for example freed or char*
s not allocated/...) or data modified different thread @ same time.
Comments
Post a Comment