I am working on a win64 version of a multi-platform program, and am having problems with occasional crashes. The below stack trace shows a typical fault from a crash dump written by drwtsn32.
Looking up the return addresses in the .map file for the executable certainly points to a location in the program that is consistent with making the calls into the C++ library that are indicated in stack trace (it is nearly always faulting in basic_string::assign()). I assume assign() may fail with bad_alloc, but the machines have plenty of free memory (8Gb). The code that is faulting in below instance is simple - just assigning a string constant to std::string. Such code can not fail, as it is impossible for the assigned value to be uninitialised, or accessed from another thread. I can only guess that memory corruption, or lack of thread safety in STL implementation is problem?
I have run the program in a heap checker (valgrind) on Linux, and there are no visible problems with heap allocation. Same program is absolutely solid on Linux and many UNIX variants. It has run for many years with no reboot on many Linux hosts, under moderately high load (although maybe I am somehow lucky...).
Can anyone please recommend a suitable approach for locating this issue?
Are there known problems with thread safety of Microsoft's implementation of STL (using VC++ 2005 Professional SP1)?