CC 5.5 ostream issue: Program receving signal SEGV in multi thread env
Hi Friends,
We are using Solaris 5.9, in a V880 machine and Sun CC 5.5 compiler.
We have a multi-threaded application, and we are using -lpthread.
We use "cout" option for our console logging. The logging mechanism works fine initially, but as soon as we create a new thread, from the new thread "cout" receive SEGV signal. We got the following dbx trace.
=================================
l@6) signal SEGV (no mapping at the fault addr
ess) in std::basic_filebuf<char,std::char_traits><char> >::xsputn at 0xfeab5718
0xfeab5718: xsputn+0x0124:stb%l2, [%l3]
Current function is std::basic_streambuf<char,std::char_traits><char> >::sputn
1044return xsputn(s, n);
(dbx) where
current thread: t@6
[1] std::basic_filebuf<char,std::char_traits><char> >::xsputn(0xfeb80810, 0x283
bc9, 0x10, 0x2, 0x0, 0x0), at 0xfeab5718
=>[2] std::basic_streambuf<char,std::char_traits><char> >::sputn(this = 0xfeb8081
0, s = 0x283bc8 "AAAThreadService", n = 16), line 1044 in "streambuf"
[3] std::operator<< <char,std::char_traits><char>,std::allocator<char> >(os = C
LASS, s = CLASS), line 549 in "ostream"
[4] AAADebug::LOG_TRACE(this = 0x2690e0, str1 = CLASS, str2 = CLASS), line 38
in "AAADebug.cpp"
[5] AAAThreadService::runThread(this = 0x2c6b88, inIndex = 3), line 136 in "AA
AThreadService.cpp"
[6] run(params = 0x268f10), line 117 in "AAAThreadService.cpp"
(dbx)
==================================
If anybody knows any any fix of this issue, please let me know. We are doubting there may be some issue in CC 5.5 for lpthread and iostream library.
Regards,
Nilanjan

