mathieu <[EMAIL PROTECTED]> writes: > I am having some issue with a program when run in a multi threaded > environment. The program is sporadically seg faulting with the > following backtrace from gdb: > > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread -1213191280 (LWP 29006)] > 0xb7daa28e in std::string::assign () from /usr/lib/libstdc++.so.6 > (gdb) bt > #0 0xb7daa28e in std::string::assign () from /usr/lib/libstdc++.so.6 > #1 0xb7daa364 in std::string::operator= () from /usr/lib/libstdc++.so.6
*Do* say which platform you are on. Assuming Linux/x86 because you posted from it. On Linux, with default gcc configuration, std::string is safe. Valgrind is your friend here. Also try compiling with -D_GLIBCXX_DEBUG (which catches many STL usage errors). > Is there a way to recompile my code > using a thread safe std::string version ? In general, you should be compiling all of your code with '-pthread'. But this is unlikely to make any difference for this crash. Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus